Documentation ¶
Index ¶
- Constants
- func CreateMssqlSchema(db *sql.DB) error
- func CreateMysqlSchema(db *sql.DB) error
- func DropMssqlSchema(db *sql.DB) error
- func DropMysqlSchema(db *sql.DB) error
- func NewMysqlClient() (sqlmer.DbClient, error)
- func NewSqlServerClient() (sqlmer.DbClient, error)
- func TryInitConfig(path string)
- type Conf
Constants ¶
View Source
const ( DefaultMysqlConnection = "testuser:testuser@tcp(127.0.0.1:3306)/test" DefaultMssqlConnection = "server=127.0.0.1.124; database=test; user id=testuser;password=testuser;" DefaultTimeout = 15 * time.Second )
Variables ¶
This section is empty.
Functions ¶
func CreateMssqlSchema ¶
CreateMssqlSchema 用于初始化 MsSql 的测试用表结构。
func CreateMysqlSchema ¶
CreateMysqlSchema 用于初始化 MySql 的测试用表结构。
func NewMysqlClient ¶ added in v1.5.0
func NewSqlServerClient ¶ added in v1.5.0
func TryInitConfig ¶ added in v1.5.0
func TryInitConfig(path string)
加载自定义配置。若给定一个 .json 文件,则读取该文件;否则认为给定的是一个目录,读取该目录下的 .db.json 文件。
Types ¶
type Conf ¶ added in v1.5.0
var TestConf Conf = Conf{ Mysql: DefaultMysqlConnection, SqlServer: DefaultMssqlConnection, }
Click to show internal directories.
Click to hide internal directories.