Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var DemoParserFiles = map[string]string{
"json": "/Users/fizz/go/src/github.com/gohouse/gorose/examples/demoParserFiles/mysql_cluster.json",
"toml": "/Users/fizz/go/src/github.com/gohouse/gorose/examples/demoParserFiles/mysql.toml",
"ini": "/Users/fizz/go/src/github.com/gohouse/gorose/examples/demoParserFiles/mysql.ini",
}
临时配置, 方便 test 测试
View Source
var (
Regex = []string{"=", ">", "<", "!=", "<>", ">=", "<=", "like", "not like", "in", "not in", "between", "not between"}
)
Functions ¶
Types ¶
type DbConfigCluster ¶
type DbConfigCluster struct {
Slave []*DbConfigSingle // 多台读服务器, 如果启用则需要放入对应的多台从服务器配置
Master *DbConfigSingle // 一台主服务器负责写数据
}
数据库集群配置 如果不启用集群, 则直接使用 DbConfig 即可 如果仍然使用此配置为非集群, 则 Slave 配置置空即可, 等同于使用 DbConfig
type DbConfigSingle ¶
type DbConfigSingle struct {
Driver string // 驱动: mysql/sqlite/oracle/mssql/postgres
EnableQueryLog bool // 是否开启sql日志
SetMaxOpenConns int // (连接池)最大打开的连接数,默认值为0表示不限制
SetMaxIdleConns int // (连接池)闲置的连接数
Prefix string // 表前缀
Dsn string // 数据库链接
}
单一数据库配置
type OrmApi ¶
type OrmApi struct {
Driver string
Prefix string
Sforce bool
Sfields []string
Swhere [][]interface{} // where
Sorder string // order
Slimit int // limit
Soffset int // offset
Sjoin [][]interface{} // join
Sdistinct bool // distinct
Sunion string // sum/count/avg/max/min
Sgroup string // group
Shaving string // having
Sdata interface{} // data
Stx *sql.Tx //Dbstruct Database
SbeforeParseWhereData [][]interface{}
Strans bool
LastInsertId int64 // insert last insert id
SqlLogs []string
LastSql string
// contains filtered or unexported fields
}
Click to show internal directories.
Click to hide internal directories.