package
0.0.0-20211208044104-4e2ed600e4cf
Repository: https://github.com/fabletang/gomybatis2.git
Documentation: pkg.go.dev

# 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..()开头的测试函数案例

# Constants

mysql链接格式为 用户名:密码@(数据库链接地址:端口)/数据库名称 例如root:root@(127.0.0.1:3306)/test?charset=utf8&parseTime=True&loc=Local此处请按格式填写你的mysql链接,这里用*号代替.

# Structs

定义数据库模型例子:Activity 活动数据,注意GoMybatis json tag 等价于数据库字段.