Versions in this module Expand all Collapse all v1 v1.0.0 Jul 17, 2018 Changes in this version + const AndCondition + const OrCondition + func AddFilterToQuery(s *schema.Schema, q sq.SelectBuilder, filter map[string]interface{}, join bool) (sq.SelectBuilder, error) + func MakeColumns(s *schema.Schema, tableName string, fields []string, join bool) []string + type CachedState struct + type CachedTransaction struct + QueryCache map[string]CachedState + func (tx *CachedTransaction) ClearCache() + func (tx *CachedTransaction) Create(resource *schema.Resource) error + func (tx *CachedTransaction) CreateContext(ctx context.Context, resource *schema.Resource) error + func (tx *CachedTransaction) Delete(s *schema.Schema, resourceID interface{}) error + func (tx *CachedTransaction) DeleteContext(ctx context.Context, s *schema.Schema, resourceID interface{}) error + func (tx *CachedTransaction) Fetch(s *schema.Schema, filter transaction.Filter, options *transaction.ViewOptions) (*schema.Resource, error) + func (tx *CachedTransaction) FetchContext(ctx context.Context, s *schema.Schema, filter transaction.Filter, ...) (*schema.Resource, error) + func (tx *CachedTransaction) List(s *schema.Schema, filter transaction.Filter, options *transaction.ViewOptions, ...) (list []*schema.Resource, total uint64, err error) + func (tx *CachedTransaction) ListContext(ctx context.Context, s *schema.Schema, filter transaction.Filter, ...) (list []*schema.Resource, total uint64, err error) + func (tx *CachedTransaction) LockFetch(s *schema.Schema, filter transaction.Filter, lockPolicy schema.LockPolicy, ...) (*schema.Resource, error) + func (tx *CachedTransaction) LockFetchContext(ctx context.Context, s *schema.Schema, filter transaction.Filter, ...) (*schema.Resource, error) + func (tx *CachedTransaction) LockList(s *schema.Schema, filter transaction.Filter, options *transaction.ViewOptions, ...) (list []*schema.Resource, total uint64, err error) + func (tx *CachedTransaction) LockListContext(ctx context.Context, s *schema.Schema, filter transaction.Filter, ...) (list []*schema.Resource, total uint64, err error) + func (tx *CachedTransaction) Query(s *schema.Schema, query string, arguments []interface{}) (list []*schema.Resource, err error) + func (tx *CachedTransaction) QueryContext(ctx context.Context, s *schema.Schema, query string, arguments []interface{}) (list []*schema.Resource, err error) + func (tx *CachedTransaction) StateUpdate(resource *schema.Resource, state *transaction.ResourceState) error + func (tx *CachedTransaction) StateUpdateContext(ctx context.Context, resource *schema.Resource, ...) error + func (tx *CachedTransaction) Update(resource *schema.Resource) error + func (tx *CachedTransaction) UpdateContext(ctx context.Context, resource *schema.Resource) error + type DB struct + DB *sqlx.DB + func NewDB(options options.Options) *DB + func (db *DB) AlterTableDef(s *schema.Schema, cascade bool) (string, []string, error) + func (db *DB) Begin() (tx transaction.Transaction, err error) + func (db *DB) BeginTx(ctx context.Context, options *transaction.TxOptions) (tx transaction.Transaction, err error) + func (db *DB) Close() + func (db *DB) Connect(sqlType, conn string, maxOpenConn int) (err error) + func (db *DB) DropTable(s *schema.Schema) error + func (db *DB) GenTableDef(s *schema.Schema, cascade bool) (string, []string) + func (db *DB) Options() options.Options + func (db *DB) RegisterTable(s *schema.Schema, cascade, migrate bool) error + func (db *DB) SetMaxOpenConns(maxIdleConns int) + type Transaction struct + func (tx *Transaction) Close() error + func (tx *Transaction) Closed() bool + func (tx *Transaction) Commit() error + func (tx *Transaction) CountContext(ctx context.Context, s *schema.Schema, filter transaction.Filter) (res uint64, err error) + func (tx *Transaction) Create(resource *schema.Resource) error + func (tx *Transaction) CreateContext(ctx context.Context, resource *schema.Resource) error + func (tx *Transaction) Delete(s *schema.Schema, resourceID interface{}) error + func (tx *Transaction) DeleteContext(ctx context.Context, s *schema.Schema, resourceID interface{}) error + func (tx *Transaction) Exec(sql string, args ...interface{}) error + func (tx *Transaction) ExecContext(ctx context.Context, sql string, args ...interface{}) error + func (tx *Transaction) Fetch(s *schema.Schema, filter transaction.Filter, options *transaction.ViewOptions) (*schema.Resource, error) + func (tx *Transaction) FetchContext(ctx context.Context, s *schema.Schema, filter transaction.Filter, ...) (*schema.Resource, error) + func (tx *Transaction) GetIsolationLevel() transaction.Type + func (tx *Transaction) List(s *schema.Schema, filter transaction.Filter, options *transaction.ViewOptions, ...) (list []*schema.Resource, total uint64, err error) + func (tx *Transaction) ListContext(ctx context.Context, s *schema.Schema, filter transaction.Filter, ...) (list []*schema.Resource, total uint64, err error) + func (tx *Transaction) LockFetch(s *schema.Schema, filter transaction.Filter, lockPolicy schema.LockPolicy, ...) (*schema.Resource, error) + func (tx *Transaction) LockFetchContext(ctx context.Context, s *schema.Schema, filter transaction.Filter, ...) (*schema.Resource, error) + func (tx *Transaction) LockList(s *schema.Schema, filter transaction.Filter, options *transaction.ViewOptions, ...) (list []*schema.Resource, total uint64, err error) + func (tx *Transaction) LockListContext(ctx context.Context, s *schema.Schema, filter transaction.Filter, ...) (list []*schema.Resource, total uint64, err error) + func (tx *Transaction) Query(s *schema.Schema, query string, arguments []interface{}) (list []*schema.Resource, err error) + func (tx *Transaction) QueryContext(ctx context.Context, s *schema.Schema, query string, arguments []interface{}) (list []*schema.Resource, err error) + func (tx *Transaction) RawTransaction() *sqlx.Tx + func (tx *Transaction) StateFetch(s *schema.Schema, filter transaction.Filter) (state transaction.ResourceState, err error) + func (tx *Transaction) StateFetchContext(ctx context.Context, s *schema.Schema, filter transaction.Filter) (state transaction.ResourceState, err error) + func (tx *Transaction) StateUpdate(resource *schema.Resource, state *transaction.ResourceState) error + func (tx *Transaction) StateUpdateContext(ctx context.Context, resource *schema.Resource, ...) error + func (tx *Transaction) Update(resource *schema.Resource) error + func (tx *Transaction) UpdateContext(ctx context.Context, resource *schema.Resource) error + type TxInterface transaction.Transaction + func MakeCachedTransaction(transx TxInterface) TxInterface