dialect

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: May 21, 2020 License: BSD-3-Clause Imports: 7 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
	ImporterPath() string
	QuoteIdent(ident string) string
	ParseDSN(params ConnParams) string
}

func GetDialectByName

func GetDialectByName(name string) Dialect

type Mssql

type Mssql struct {
}

func (Mssql) ImporterPath added in v0.9.1

func (Mssql) ImporterPath() string

func (Mssql) Name

func (Mssql) Name() string

func (Mssql) ParseDSN added in v0.3.2

func (Mssql) ParseDSN(params ConnParams) string

func (Mssql) QuoteIdent

func (Mssql) QuoteIdent(ident string) string

type Mysql

type Mysql struct {
}

func (Mysql) ImporterPath added in v0.9.1

func (Mysql) ImporterPath() string

func (Mysql) Name

func (Mysql) Name() string

func (Mysql) ParseDSN added in v0.3.2

func (Mysql) ParseDSN(params ConnParams) string

func (Mysql) QuoteIdent

func (Mysql) QuoteIdent(ident string) string

type Oracle

type Oracle struct {
}

func (Oracle) ImporterPath added in v0.9.1

func (Oracle) ImporterPath() string

func (Oracle) Name

func (Oracle) Name() string

func (Oracle) ParseDSN added in v0.3.2

func (Oracle) ParseDSN(params ConnParams) string

func (Oracle) QuoteIdent

func (Oracle) QuoteIdent(ident string) string

type Postgres

type Postgres struct {
}

func (Postgres) ImporterPath added in v0.9.1

func (Postgres) ImporterPath() string

func (Postgres) Name

func (Postgres) Name() string

func (Postgres) ParseDSN added in v0.3.2

func (Postgres) ParseDSN(params ConnParams) string

func (Postgres) QuoteIdent

func (Postgres) QuoteIdent(ident string) string

type Redis

type Redis struct {
	Values url.Values
	// contains filtered or unexported fields
}

func NewRedis added in v0.9.5

func NewRedis(addr, opts string) (*Redis, error)

func (*Redis) Connect

func (r *Redis) Connect(verbose bool) (redis.Conn, error)

func (Redis) ImporterPath added in v0.9.1

func (Redis) ImporterPath() string

func (Redis) Name

func (Redis) Name() string

func (*Redis) ParseDSN added in v0.3.2

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

func (*Redis) ParseOptions added in v0.9.5

func (r *Redis) ParseOptions(opts string) (err error)

func (Redis) QuoteIdent

func (Redis) QuoteIdent(ident string) string

type Sqlite

type Sqlite struct {
}

func (Sqlite) ImporterPath added in v0.9.1

func (Sqlite) ImporterPath() string

func (Sqlite) Name

func (Sqlite) Name() string

func (Sqlite) ParseDSN added in v0.3.2

func (Sqlite) ParseDSN(params ConnParams) string

func (Sqlite) QuoteIdent

func (Sqlite) QuoteIdent(ident string) string

type Sqlite3 added in v0.3.3

type Sqlite3 struct {
	Sqlite
}

func (Sqlite3) Name added in v0.3.3

func (Sqlite3) Name() string

Jump to

Keyboard shortcuts

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