Documentation ¶
Index ¶
- Variables
- func New(db *sql.DB, dbname string, dia Dialect) tuple.Store
- func Open(name, addr, db string) (tuple.Store, error)
- func OpenSQL(name, addr, db string) (*sql.DB, error)
- func Register(reg Registration)
- type Builder
- func (b *Builder) Args() []interface{}
- func (b *Builder) EqPlace(names []string, args []interface{})
- func (b *Builder) EqPlaceAnd(names []string, args []interface{})
- func (b *Builder) Idents(names ...string)
- func (b *Builder) Literal(s string)
- func (b *Builder) OpPlace(names []string, op string, args []interface{})
- func (b *Builder) OpPlaceAnd(names []string, op string, args []interface{})
- func (b *Builder) Place(args ...interface{})
- func (b *Builder) Reset()
- func (b *Builder) String() string
- func (b *Builder) Write(s string)
- type DSNFunc
- type Dialect
- type ErrorFunc
- type Registration
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrTableNotFound = tuple.ErrTableNotFound
Functions ¶
Types ¶
type Builder ¶
type Builder struct {
// contains filtered or unexported fields
}
func (*Builder) EqPlaceAnd ¶
func (*Builder) OpPlaceAnd ¶
type DSNFunc ¶
DSNFunc is a function for building a Data Source Name for SQL driver, given a address and the database name.
type Dialect ¶
type Dialect struct { Errors ErrorFunc BytesType string StringType string BytesKeyType string StringKeyType string TimeType string StringTypeCollation string AutoType string QuoteIdentifierFunc func(s string) string Placeholder func(i int) string // DefaultSchema will be used to query table metadata. // If not set, defaults to the database name. DefaultSchema string // ListColumns is a query that will be executed to get columns info. // Two parameters will be passed to the query: current schema and the table name. ListColumns string // Unsigned indicates that a database supports UNSIGNED modifier for integer types. Unsigned bool // NoIteratorsWhenMutating mark indicates that backend cannot run iterators and // mutations in the same transaction (example: SELECT and DELETE while iterating). NoIteratorsWhenMutating bool // ReplaceStmt indicates that backend supports REPLACE statement. ReplaceStmt bool // OnConflict indicates that backend supports ON CONFLICT in INSERT statement. OnConflict bool // Returning indicates that INSERT queries needs an RETURNING keyword to return last // inserted id. Returning bool ColumnCommentInline func(s string) string ColumnCommentSet func(b *Builder, tbl, col, s string) }
func (*Dialect) NewBuilder ¶
func (*Dialect) QuoteIdentifier ¶
func (*Dialect) QuoteString ¶
func (*Dialect) SetDefaults ¶
func (d *Dialect) SetDefaults()
type Registration ¶
type Registration struct { base.Registration Driver string DSN DSNFunc Dialect Dialect }
Registration is an information about the database driver.
func ByName ¶
func ByName(name string) *Registration
ByName returns a registered database driver by it's name.
Click to show internal directories.
Click to hide internal directories.