Documentation ¶
Index ¶
- func Open(ctx context.Context, driver, connURL string) (storage.Driver, error)
- type AbstractSyntax
- func (sx *AbstractSyntax) DeleteQuery(tableName string, where WhereStmt, whereExt string) string
- func (sx *AbstractSyntax) GetQuery(tableName string, where WhereStmt, whereExt string) string
- func (sx *AbstractSyntax) SelectQuery(tableName string, where WhereStmt, whereExt string) string
- func (sx *AbstractSyntax) UpsertQuery(tableName string, insertFields DataFields, keyFields []string) string
- type Bind
- func (b *Bind) Del(ctx context.Context, ectx keypattern.ExecContext) error
- func (b *Bind) Get(ctx context.Context, ectx keypattern.ExecContext) (Record, error)
- func (b *Bind) List(ctx context.Context, ectx keypattern.ExecContext) ([]Record, error)
- func (b *Bind) Upsert(ctx context.Context, ectx keypattern.ExecContext, value []byte) error
- type BindAbstract
- func (b *BindAbstract) Del(ctx context.Context, ectx keypattern.ExecContext) error
- func (b *BindAbstract) Get(ctx context.Context, ectx keypattern.ExecContext) (Record, error)
- func (b *BindAbstract) List(ctx context.Context, ectx keypattern.ExecContext) ([]Record, error)
- func (b *BindAbstract) MatchKey(key string, ectx keypattern.ExecContext) bool
- func (b *BindAbstract) MatchPattern(pt string, ectx keypattern.ExecContext) bool
- func (b *BindAbstract) TableName() string
- func (b *BindAbstract) Upsert(ctx context.Context, ectx keypattern.ExecContext, value []byte) error
- type DataFields
- type MysqlSyntax
- type Query
- type Record
- type Syntax
- type WhereStmt
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type AbstractSyntax ¶
type AbstractSyntax struct {
// contains filtered or unexported fields
}
func NewAbstractSyntax ¶
func NewAbstractSyntax(escape string) *AbstractSyntax
func (*AbstractSyntax) DeleteQuery ¶
func (sx *AbstractSyntax) DeleteQuery(tableName string, where WhereStmt, whereExt string) string
func (*AbstractSyntax) GetQuery ¶
func (sx *AbstractSyntax) GetQuery(tableName string, where WhereStmt, whereExt string) string
func (*AbstractSyntax) SelectQuery ¶
func (sx *AbstractSyntax) SelectQuery(tableName string, where WhereStmt, whereExt string) string
func (*AbstractSyntax) UpsertQuery ¶
func (sx *AbstractSyntax) UpsertQuery(tableName string, insertFields DataFields, keyFields []string) string
type Bind ¶
type Bind struct { BindAbstract // contains filtered or unexported fields }
func NewBindFromTableName ¶
func (*Bind) Del ¶
func (b *Bind) Del(ctx context.Context, ectx keypattern.ExecContext) error
func (*Bind) Get ¶
func (b *Bind) Get(ctx context.Context, ectx keypattern.ExecContext) (Record, error)
func (*Bind) List ¶
func (b *Bind) List(ctx context.Context, ectx keypattern.ExecContext) ([]Record, error)
func (*Bind) Upsert ¶
func (b *Bind) Upsert(ctx context.Context, ectx keypattern.ExecContext, value []byte) error
type BindAbstract ¶
type BindAbstract struct { DBNum int Pattern *keypattern.Pattern Syntax Syntax GetQuery *query ListQuery *query UpsertQuery *query DelQuery *query }
func NewBindAbstract ¶
func NewBindAbstract(dbnum int, syntax Syntax, pattern, getQuery, listQuery, upsertQuery, delQuery string) *BindAbstract
func NewBindAbstractFromTableName ¶
func NewBindAbstractFromTableName(dbnum int, syntax Syntax, pattern, tableName, whereExt string, readonly bool) *BindAbstract
func (*BindAbstract) Del ¶
func (b *BindAbstract) Del(ctx context.Context, ectx keypattern.ExecContext) error
func (*BindAbstract) Get ¶
func (b *BindAbstract) Get(ctx context.Context, ectx keypattern.ExecContext) (Record, error)
func (*BindAbstract) List ¶
func (b *BindAbstract) List(ctx context.Context, ectx keypattern.ExecContext) ([]Record, error)
func (*BindAbstract) MatchKey ¶
func (b *BindAbstract) MatchKey(key string, ectx keypattern.ExecContext) bool
func (*BindAbstract) MatchPattern ¶
func (b *BindAbstract) MatchPattern(pt string, ectx keypattern.ExecContext) bool
func (*BindAbstract) TableName ¶
func (b *BindAbstract) TableName() string
func (*BindAbstract) Upsert ¶
func (b *BindAbstract) Upsert(ctx context.Context, ectx keypattern.ExecContext, value []byte) error
type DataFields ¶
func (DataFields) Columns ¶
func (df DataFields) Columns(escape string) string
func (DataFields) SetValues ¶
func (df DataFields) SetValues(escape string) string
func (DataFields) Values ¶
func (df DataFields) Values() string
type MysqlSyntax ¶
type MysqlSyntax struct {
AbstractSyntax
}
func NewMysqlSyntax ¶
func NewMysqlSyntax() *MysqlSyntax
func (*MysqlSyntax) UpsertQuery ¶
func (sx *MysqlSyntax) UpsertQuery(tableName string, insertFields DataFields, keyFields []string) string
type Query ¶
type Query struct { TableName string // contains filtered or unexported fields }
func ParseQuery ¶
func (*Query) Args ¶
func (q *Query) Args(ectx keypattern.ExecContext) []interface{}
type Syntax ¶
type Syntax interface { UpsertQuery(tableName string, insertFields DataFields, keyFields []string) string GetQuery(tableName string, where WhereStmt, whereExt string) string SelectQuery(tableName string, where WhereStmt, whereExt string) string DeleteQuery(tableName string, where WhereStmt, whereExt string) string }
Click to show internal directories.
Click to hide internal directories.