package
Version:
v5.0.8+incompatible
Opens a new window with list of versions in this module.
Published: May 5, 2019
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 然后打开项目
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"`
Uuid string `json:"uuid"`
Name string `json:"name"`
PcLink string `json:"pcLink"`
H5Link string `json:"h5Link"`
Version int `json:"version"`
CreateTime time.Time `json:"createTime"`
DeleteFlag int `json:"deleteFlag"`
}
定义数据库模型
例子:Activity 活动数据
Source Files
¶
Click to show internal directories.
Click to hide internal directories.