Documentation ¶
Index ¶
Constants ¶
View Source
const MSSQL_DEFAULT_PORT uint16 = 1433
View Source
const MYSQL_DEFAULT_PORT uint16 = 3306
View Source
const ORACLE_DEFAULT_PORT uint16 = 1521
View Source
const PGSQL_DEFAULT_PORT uint16 = 5432
View Source
const REDIS_DEFAULT_PORT uint16 = 6379
Variables ¶
View Source
var ( ConcatWith = utils.ConcatWith WrapWith = utils.WrapWith )
Functions ¶
This section is empty.
Types ¶
type ConnParams ¶
type ConnParams struct { Host string Port int Username string Password string Database string Options map[string]interface{} }
连接配置
func (ConnParams) GetAddr ¶
func (p ConnParams) GetAddr(defaultHost string, defaultPort uint16) string
func (ConnParams) StrPort ¶
func (p ConnParams) StrPort(defaultPort uint16) string
type Dialect ¶
type Dialect interface { Name() string QuoteIdent(ident string) string GetDSN(params ConnParams) string }
func GetDialectByName ¶
type Mssql ¶
type Mssql struct { }
func (Mssql) GetDSN ¶
func (Mssql) GetDSN(params ConnParams) string
func (Mssql) QuoteIdent ¶
type Mysql ¶
type Mysql struct { }
func (Mysql) GetDSN ¶
func (Mysql) GetDSN(params ConnParams) string
func (Mysql) QuoteIdent ¶
type Oracle ¶
type Oracle struct { }
func (Oracle) GetDSN ¶
func (Oracle) GetDSN(params ConnParams) string
func (Oracle) QuoteIdent ¶
type Postgres ¶
type Postgres struct { }
func (Postgres) GetDSN ¶
func (Postgres) GetDSN(params ConnParams) string
func (Postgres) QuoteIdent ¶
type Redis ¶
type Redis struct {
Options []redis.DialOption
}
func (*Redis) GetDSN ¶
func (r *Redis) GetDSN(params ConnParams) string
func (Redis) QuoteIdent ¶
Click to show internal directories.
Click to hide internal directories.