testenv

package
v1.5.0 Latest Latest
Warning

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

Go to latest
Published: Apr 10, 2022 License: MIT Imports: 9 Imported by: 0

Documentation

Index

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

func CreateMssqlSchema(db *sql.DB) error

CreateMssqlSchema 用于初始化 MsSql 的测试用表结构。

func CreateMysqlSchema

func CreateMysqlSchema(db *sql.DB) error

CreateMysqlSchema 用于初始化 MySql 的测试用表结构。

func DropMssqlSchema

func DropMssqlSchema(db *sql.DB) error

DropMssqlSchema 用于初始化 MsSql 的测试用表结构。

func DropMysqlSchema

func DropMysqlSchema(db *sql.DB) error

DropMysqlSchema 用于初始化MySql的测试用表结构。

func NewMysqlClient added in v1.5.0

func NewMysqlClient() (sqlmer.DbClient, error)

func NewSqlServerClient added in v1.5.0

func NewSqlServerClient() (sqlmer.DbClient, error)

func TryInitConfig added in v1.5.0

func TryInitConfig(path string)

加载自定义配置。若给定一个 .json 文件,则读取该文件;否则认为给定的是一个目录,读取该目录下的 .db.json 文件。

Types

type Conf added in v1.5.0

type Conf struct {
	Mysql     string
	SqlServer string
}
var TestConf Conf = Conf{
	Mysql:     DefaultMysqlConnection,
	SqlServer: DefaultMssqlConnection,
}

Jump to

Keyboard shortcuts

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