1

gorose文档2.0

 2 years ago
source link: https://www.kancloud.cn/fizz/gorose-2/1135835
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

1.应用篇废话

关于gorose

gorose是一个小巧强悍的golang orm,借鉴自laravel's eloquent的优雅api及链式调用,让数据库操作称为一种享受.

其他语言入手姿势

  1. php: 使用过laravel的orm就可以快速上手使用
  2. python: 使用过orator orm的用户,可以快速上手
  3. ruby: 使用过rails的orm就可以快速上手

mysql : https://github.com/go-sql-driver/mysql
sqlite3 : https://github.com/mattn/go-sqlite3
postgres : https://github.com/lib/pq
oracle : https://github.com/mattn/go-oci8
mssql : https://github.com/denisenkom/go-mssqldb
clickhouse : https://github.com/kshvakov/clickhouse

  • go.mod
require github.com/gohouse/gorose/v2 v2.1.5

重要的事情说三遍!
重要的事情说三遍!
重要的事情说三遍!
使用的时候必须import "github.com/gohouse/gorose/v2"方可正常使用.
千万不要漏掉末尾的v2,这个是vgo的规定

  • docker
docker run -it --rm ababy/gorose sh -c "go run main.go"

docker 镜像: ababy/gorose, docker镜像包含了gorose所必须的包和运行环境, 查看Dockerfile

  • go get
go get -u github.com/gohouse/gorose/v2
  • 支持传入struct,map或字符串表名
  • 读写分离集群支持
  • 海量数据自动分块处理
  • 一键开启事务,自动回滚和提交
  • 模块化架构,自由扩展
  1. 应用篇废话
    各种简述说明
  2. 快速使用的正确姿势
    完整的示例演示使用流程, 以便快速上手和参考. 后续章节在第2章的基础之上展开讲解
  3. 配置及链接
    多种配置格式, 各种姿势, 随便使用
  4. orm的使用
  5. session原生查询
  6. 各种骚操作

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK