dialect

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Apr 15, 2020 License: Apache-2.0 Imports: 5 Imported by: 0

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

func GetDialectByName(name string) Dialect

type Mssql

type Mssql struct {
}

func (Mssql) GetDSN

func (Mssql) GetDSN(params ConnParams) string

func (Mssql) Name

func (Mssql) Name() string

func (Mssql) QuoteIdent

func (Mssql) QuoteIdent(ident string) string

type Mysql

type Mysql struct {
}

func (Mysql) GetDSN

func (Mysql) GetDSN(params ConnParams) string

func (Mysql) Name

func (Mysql) Name() string

func (Mysql) QuoteIdent

func (Mysql) QuoteIdent(ident string) string

type Oracle

type Oracle struct {
}

func (Oracle) GetDSN

func (Oracle) GetDSN(params ConnParams) string

func (Oracle) Name

func (Oracle) Name() string

func (Oracle) QuoteIdent

func (Oracle) QuoteIdent(ident string) string

type Postgres

type Postgres struct {
}

func (Postgres) GetDSN

func (Postgres) GetDSN(params ConnParams) string

func (Postgres) Name

func (Postgres) Name() string

func (Postgres) QuoteIdent

func (Postgres) QuoteIdent(ident string) string

type Redis

type Redis struct {
	Options []redis.DialOption
}

func (*Redis) Connect

func (r *Redis) Connect(params ConnParams) (redis.Conn, error)

func (*Redis) GetDSN

func (r *Redis) GetDSN(params ConnParams) string

func (Redis) Name

func (Redis) Name() string

func (Redis) QuoteIdent

func (Redis) QuoteIdent(ident string) string

type Sqlite

type Sqlite struct {
}

func (Sqlite) GetDSN

func (Sqlite) GetDSN(params ConnParams) string

func (Sqlite) Name

func (Sqlite) Name() string

func (Sqlite) QuoteIdent

func (Sqlite) QuoteIdent(ident string) string

Jump to

Keyboard shortcuts

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