Documentation ¶
Index ¶
- func NewDB(name string, masterName string, pingInterval time.Duration, ...) proto.DB
- type DB
- func (db *DB) Active() int64
- func (db *DB) Available() int64
- func (db *DB) Begin(ctx context.Context) (proto.Tx, proto.Result, error)
- func (db *DB) Capacity() int64
- func (db *DB) CheckAlive() error
- func (db *DB) Close()
- func (db *DB) ExecuteFieldList(ctx context.Context, table, wildcard string) ([]proto.Field, error)
- func (db *DB) ExecuteSql(ctx context.Context, sql string, args ...interface{}) (proto.Result, uint16, error)
- func (db *DB) ExecuteSqlDirectly(sql string, args ...interface{}) (proto.Result, uint16, error)
- func (db *DB) ExecuteStmt(ctx context.Context, stmt *proto.Stmt) (proto.Result, uint16, error)
- func (db *DB) Exhausted() int64
- func (db *DB) IdleClosed() int64
- func (db *DB) IdleTimeout() time.Duration
- func (db *DB) InUse() int64
- func (db *DB) IsClosed() bool
- func (db *DB) IsMaster() bool
- func (db *DB) MasterName() string
- func (db *DB) MaxCap() int64
- func (db *DB) Name() string
- func (db *DB) Ping() error
- func (db *DB) Query(ctx context.Context, query string) (proto.Result, uint16, error)
- func (db *DB) QueryDirectly(query string) (proto.Result, uint16, error)
- func (db *DB) ReadWeight() int
- func (db *DB) SetCapacity(capacity int) error
- func (db *DB) SetConnectionPostFilters(filters []proto.DBConnectionPostFilter)
- func (db *DB) SetConnectionPreFilters(filters []proto.DBConnectionPreFilter)
- func (db *DB) SetIdleTimeout(idleTimeout time.Duration)
- func (db *DB) SetReadWeight(weight int)
- func (db *DB) SetWriteWeight(weight int)
- func (db *DB) StatsJSON() string
- func (db *DB) Status() proto.DBStatus
- func (db *DB) UseDB(ctx context.Context, schema string) error
- func (db *DB) WaitCount() int64
- func (db *DB) WaitTime() time.Duration
- func (db *DB) WriteWeight() int
- type Tx
- func (tx *Tx) Close()
- func (tx *Tx) Commit(ctx context.Context) (result proto.Result, err error)
- func (tx *Tx) ExecuteSql(ctx context.Context, sql string, args ...interface{}) (proto.Result, uint16, error)
- func (tx *Tx) ExecuteSqlDirectly(sql string, args ...interface{}) (proto.Result, uint16, error)
- func (tx *Tx) ExecuteStmt(ctx context.Context, stmt *proto.Stmt) (proto.Result, uint16, error)
- func (tx *Tx) Query(ctx context.Context, query string) (proto.Result, uint16, error)
- func (tx *Tx) QueryDirectly(query string) (proto.Result, uint16, error)
- func (tx *Tx) Rollback(ctx context.Context, stmt *ast.RollbackStmt) (result proto.Result, err error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type DB ¶
type DB struct {
// contains filtered or unexported fields
}
func (*DB) Active ¶
Active returns the number of active (i.e. non-nil) connections either in the pool or claimed for use
func (*DB) CheckAlive ¶ added in v0.4.0
func (*DB) ExecuteFieldList ¶
func (*DB) ExecuteSql ¶
func (*DB) ExecuteSqlDirectly ¶ added in v0.4.0
func (*DB) ExecuteStmt ¶
func (*DB) IdleClosed ¶
IdleClosed returns the count of connections closed due to idle timeout.
func (*DB) IdleTimeout ¶
IdleTimeout returns the idle timeout.
func (*DB) MasterName ¶ added in v0.4.0
func (*DB) QueryDirectly ¶ added in v0.4.0
func (*DB) ReadWeight ¶ added in v0.4.0
func (*DB) SetCapacity ¶
func (*DB) SetConnectionPostFilters ¶
func (db *DB) SetConnectionPostFilters(filters []proto.DBConnectionPostFilter)
func (*DB) SetConnectionPreFilters ¶
func (db *DB) SetConnectionPreFilters(filters []proto.DBConnectionPreFilter)
func (*DB) SetIdleTimeout ¶
func (*DB) SetReadWeight ¶ added in v0.4.0
func (*DB) SetWriteWeight ¶ added in v0.4.0
func (*DB) WriteWeight ¶ added in v0.4.0
type Tx ¶
type Tx struct {
// contains filtered or unexported fields
}
func (*Tx) ExecuteSql ¶
func (*Tx) ExecuteSqlDirectly ¶ added in v0.4.0
func (*Tx) ExecuteStmt ¶
func (*Tx) QueryDirectly ¶ added in v0.4.0
Click to show internal directories.
Click to hide internal directories.