package
Version:
v6.2.4+incompatible
Opens a new window with list of versions in this module.
Published: May 31, 2020
License: Apache-2.0
Opens a new window with license information.
Imports: 1
Opens a new window with list of imports.
Imported by: 0
Opens a new window with list of known importers.
README
¶
数据库驱动列表
Mysql: github.com/go-sql-driver/mysql
MyMysql: github.com/ziutek/mymysql/godrv
Postgres: github.com/lib/pq
Tidb: github.com/pingcap/tidb
SQLite: github.com/mattn/go-sqlite3
MsSql: github.com/denisenkom/go-mssqldb
MsSql: github.com/lunny/godbc
Oracle: github.com/mattn/go-oci8
CockroachDB(Postgres): github.com/lib/pq
example运行教程
1 下载安装 GoLand(因为goland对test各种特性支持非常良好) 然后打开项目
2 设置好GoPath,用go get 命令下载GoMybatis和对应的数据库驱动
go get github.com/zhuxiujia/GoMybatis
go get github.com/go-sql-driver/mysql
3 导入example/database.sql 到 你的 mysql 数据库
4 修改Example_config.go中mysql数据库地址,在GoLand中点击 三角形绿色按钮 运行func Test..()开头的测试函数案例
Documentation
¶
mysql链接格式为 用户名:密码@(数据库链接地址:端口)/数据库名称 例如root:root@(127.0.0.1:3306)/test?charset=utf8&parseTime=True&loc=Local
此处请按格式填写你的mysql链接,这里用*号代替
type Activity struct {
Id string `json:"id,omitempty"`
Uuid string `json:"uuid"`
Name string `json:"name"`
PcLink string `json:"pc_link"`
H5Link string `json:"h5_link"`
Version int `json:"version"`
CreateTime time.Time `json:"create_time"`
DeleteFlag int `json:"delete_flag"`
}
定义数据库模型
例子:Activity 活动数据
Source Files
¶
Click to show internal directories.
Click to hide internal directories.