example

package
v5.1.5+incompatible Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 27, 2019 License: Apache-2.0 Imports: 1 Imported by: 0

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

Index

Constants

View Source
const MysqlUri = "*"

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

Variables

This section is empty.

Functions

This section is empty.

Types

type Activity

type Activity struct {
	Id         string    `json:"id"`
	Uuid       string    `json:"uuid"`
	Name       string    `json:"name"`
	PcLink     string    `json:"pcLink"`
	H5Link     string    `json:"h5Link"`
	Remark     string    `json:"remark"`
	Version    int       `json:"version"`
	CreateTime time.Time `json:"createTime"`
	DeleteFlag int       `json:"deleteFlag"`
}

定义数据库模型 例子:Activity 活动数据

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL