Documentation ¶
Index ¶
- func NewDB(name string, pingInterval time.Duration, pingTimesForChangeStatus int, ...) 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) 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) 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() (closed bool)
- func (db *DB) MaxCap() int64
- func (db *DB) Name() string
- func (db *DB) Ping()
- func (db *DB) Query(ctx context.Context, query string) (proto.Result, uint16, error)
- 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) StatsJSON() string
- func (db *DB) Status() proto.DBStatus
- func (db *DB) TestConn() error
- func (db *DB) UseDB(ctx context.Context, schema string) error
- func (db *DB) WaitCount() int64
- func (db *DB) WaitTime() time.Duration
- 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) 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) Rollback(ctx context.Context) (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) ExecuteFieldList ¶
func (*DB) ExecuteSql ¶
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) SetCapacity ¶
func (*DB) SetConnectionPostFilters ¶
func (db *DB) SetConnectionPostFilters(filters []proto.DBConnectionPostFilter)
func (*DB) SetConnectionPreFilters ¶
func (db *DB) SetConnectionPreFilters(filters []proto.DBConnectionPreFilter)
func (*DB) SetIdleTimeout ¶
type Tx ¶
type Tx struct {
// contains filtered or unexported fields
}
func (*Tx) ExecuteSql ¶
func (*Tx) ExecuteStmt ¶
Click to show internal directories.
Click to hide internal directories.