Documentation ¶
Index ¶
- func Pagination(db *gorm.DB, page, size int) *gorm.DB
- type CbitSqlConnection
- type CbitSqlSetting
- type Common
- type DbSetting
- type Dsn
- type GormPool
- type MySqlConnection
- type MySqlPool
- type MySqlSetting
- type PostgresConnection
- type PostgresPool
- type PostgresSetting
- type SqlServerConnection
- type SqlServerPool
- type SqlServerSetting
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type CbitSqlConnection ¶ added in v2.8.0
type CbitSqlSetting ¶ added in v2.8.0
type CbitSqlSetting struct { Database string `yaml:"database"` Rws bool `yaml:"rws"` Main *MySqlConnection `yaml:"main"` Sources map[string]*CbitSqlConnection `yaml:"sources"` Replicas map[string]*CbitSqlConnection `yaml:"replicas"` }
type DbSetting ¶
type DbSetting struct { Common *Common `yaml:"common,omitempty"` MySql *MySqlSetting `yaml:"mysql,omitempty"` Postgres *PostgresSetting `yaml:"postgres,omitempty"` SqlServer *SqlServerSetting `yaml:"sqlServer,omitempty"` CbitSql *CbitSqlSetting `yaml:"cbitSql,omitempty"` }
var DbSet DbSetting
func (DbSetting) ExampleYaml ¶ added in v2.11.2
type MySqlConnection ¶
type MySqlPool ¶
type MySqlPool struct {
// contains filtered or unexported fields
}
var ( MySqlDsnFormat = "%s:%s@tcp(%s:%d)/%s?charset=%s&parseTime=True&loc=Local" MySqlPoolApp MySqlPool )
type MySqlSetting ¶
type MySqlSetting struct { Database string `yaml:"database"` Charset string `yaml:"charset"` Collation string `yaml:"collation"` Rws bool `yaml:"rws"` Main *MySqlConnection `yaml:"main"` Sources map[string]*MySqlConnection `yaml:"sources"` Replicas map[string]*MySqlConnection `yaml:"replicas"` }
type PostgresConnection ¶
type PostgresPool ¶
type PostgresPool struct {
// contains filtered or unexported fields
}
var ( PostgresDsnFormat = "host=%s user=%s password=%s dbname=%s port=%d sslmode=%s TimeZone=%s" PostgresPoolApp PostgresPool )
func (PostgresPool) Once ¶ added in v2.9.0
func (PostgresPool) Once(dbSetting *DbSetting) GormPool
Once 单例化:postgres链接池
type PostgresSetting ¶
type PostgresSetting struct {
Main *PostgresConnection `yaml:"main"`
}
type SqlServerConnection ¶
type SqlServerPool ¶
type SqlServerPool struct {
// contains filtered or unexported fields
}
var ( SqlServerDsnFormat = "sqlserver://%s:%s@%s:?%d?database=%s" SqlServerPoolApp SqlServerPool )
func (SqlServerPool) Once ¶ added in v2.9.0
func (SqlServerPool) Once(dbSetting *DbSetting) GormPool
Once 单例化:sql server连接池
type SqlServerSetting ¶
type SqlServerSetting struct {
Main *SqlServerConnection `yaml:"main"`
}
Click to show internal directories.
Click to hide internal directories.