Documentation
¶
Index ¶
- Constants
- Variables
- type ConnParams
- type Dialect
- type Mssql
- type Mysql
- type Oracle
- type Postgres
- type Redis
- func (r *Redis) Connect(verbose bool) (redis.Conn, error)
- func (r *Redis) GetOptions() []redis.DialOption
- func (Redis) ImporterPath() string
- func (Redis) Name() string
- func (r *Redis) ParseDSN(params ConnParams) string
- func (r *Redis) ParseOptions(opts string) (err error)
- func (Redis) QuoteIdent(ident string) string
- type Sqlite
- type Sqlite3
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 `json:"host" yaml:"host" toml:"host"` Port int `json:"port,omitempty" yaml:"port,omitempty" toml:"port"` Username string `json:"username,omitempty" yaml:"username,omitempty" toml:"username"` Password string `json:"password" yaml:"password" toml:"password"` Database string `json:"database" yaml:"database" toml:"database"` Options map[string]interface{} `json:"options,omitempty" yaml:"options,omitempty" toml:"options"` }
连接配置
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 ImporterPath() string QuoteIdent(ident string) string ParseDSN(params ConnParams) string }
func GetDialectByName ¶
type Mssql ¶
type Mssql struct { }
func (Mssql) ImporterPath ¶
func (Mssql) ParseDSN ¶
func (Mssql) ParseDSN(params ConnParams) string
func (Mssql) QuoteIdent ¶
type Mysql ¶
type Mysql struct { }
func (Mysql) ImporterPath ¶
func (Mysql) ParseDSN ¶
func (Mysql) ParseDSN(params ConnParams) string
func (Mysql) QuoteIdent ¶
type Oracle ¶
type Oracle struct { }
func (Oracle) ImporterPath ¶
func (Oracle) ParseDSN ¶
func (Oracle) ParseDSN(params ConnParams) string
func (Oracle) QuoteIdent ¶
type Postgres ¶
type Postgres struct { }
func (Postgres) ImporterPath ¶
func (Postgres) ParseDSN ¶
func (Postgres) ParseDSN(params ConnParams) string
func (Postgres) QuoteIdent ¶
type Redis ¶
func (*Redis) GetOptions ¶
func (r *Redis) GetOptions() []redis.DialOption
func (Redis) ImporterPath ¶
func (*Redis) ParseDSN ¶
func (r *Redis) ParseDSN(params ConnParams) string
func (*Redis) ParseOptions ¶
func (Redis) QuoteIdent ¶
type Sqlite ¶
type Sqlite struct { }
func (Sqlite) ImporterPath ¶
func (Sqlite) ParseDSN ¶
func (Sqlite) ParseDSN(params ConnParams) string
func (Sqlite) QuoteIdent ¶
Click to show internal directories.
Click to hide internal directories.