Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type ConnectOptionFunc ¶
type ConnectOptionFunc func(*connectOption)
ConnectOptionFunc is a function to set the connection option.
func ConnectWithMaxConnLifetime ¶
func ConnectWithMaxConnLifetime(d time.Duration) ConnectOptionFunc
ConnectWithMaxConnLifetime sets the maximum lifetime of a connection.
func ConnectWithMaxIdleConnLifetime ¶
func ConnectWithMaxIdleConnLifetime(d time.Duration) ConnectOptionFunc
ConnectWithMaxIdleConnLifetime sets the maximum lifetime of an idle connection.
func ConnectWithMaxIdleConnNum ¶
func ConnectWithMaxIdleConnNum(num int) ConnectOptionFunc
ConnectWithMaxIdleConnNum sets the maximum number of idle connections.
func ConnectWithMaxOpenConnNum ¶
func ConnectWithMaxOpenConnNum(num int) ConnectOptionFunc
ConnectWithMaxOpenConnNum sets the maximum number of open connections.
type Driver ¶
type Driver interface { // Translator returns a translator of SQL. Translator() Translator }
Driver is a driver of database.
type MySQLDriver ¶
type MySQLDriver struct{}
MySQLDriver is a driver of MySQL.
func (MySQLDriver) String ¶
func (d MySQLDriver) String() string
func (MySQLDriver) Translator ¶
func (d MySQLDriver) Translator() Translator
Translator returns a translator of SQL.
type OracleDriver ¶
type OracleDriver struct{}
OracleDriver is a driver of Oracle.
func (OracleDriver) String ¶
func (o OracleDriver) String() string
func (OracleDriver) Translator ¶
func (o OracleDriver) Translator() Translator
Translator is a function to translate a matched string.
type PostgresDriver ¶
type PostgresDriver struct{}
PostgresDriver is a driver of PostgreSQL.
func (PostgresDriver) String ¶
func (d PostgresDriver) String() string
func (PostgresDriver) Translator ¶
func (d PostgresDriver) Translator() Translator
Translator is a function to translate a matched string.
type SQLiteDriver ¶
type SQLiteDriver struct{}
SQLiteDriver is a driver of SQLite.
func (SQLiteDriver) String ¶
func (d SQLiteDriver) String() string
func (SQLiteDriver) Translator ¶
func (d SQLiteDriver) Translator() Translator
Translator returns a translator of SQL.
type TranslateFunc ¶
TranslateFunc is a function to translate the matched string.
func (TranslateFunc) Translate ¶
func (f TranslateFunc) Translate(matched string) string
Translate implements the Translator interface.
type Translator ¶
Translator is an interface for translating the matched string.