Documentation
¶
Index ¶
- Constants
- Variables
- func IsClosedErr(err error) bool
- type Batch
- type DB
- func (this *DB) Begin() (*sql.Tx, error)
- func (this *DB) BeginUpdating() bool
- func (this *DB) Close() error
- func (this *DB) EnableStat(b bool)
- func (this *DB) EndUpdating()
- func (this *DB) Exec(query string, args ...any) (sql.Result, error)
- func (this *DB) ExecContext(ctx context.Context, query string, args ...any) (sql.Result, error)
- func (this *DB) Prepare(query string) (*Stmt, error)
- func (this *DB) Query(query string, args ...any) (*sql.Rows, error)
- func (this *DB) QueryRow(query string, args ...any) *sql.Row
- func (this *DB) RawDB() *sql.DB
- func (this *DB) SetMaxOpenConns(n int)
- type QueryLabel
- type QueryStat
- type QueryStatManager
- type Stmt
- func (this *Stmt) Close() error
- func (this *Stmt) EnableStat()
- func (this *Stmt) Exec(args ...any) (result sql.Result, err error)
- func (this *Stmt) ExecContext(ctx context.Context, args ...any) (result sql.Result, err error)
- func (this *Stmt) Query(args ...any) (*sql.Rows, error)
- func (this *Stmt) QueryContext(ctx context.Context, args ...any) (*sql.Rows, error)
- func (this *Stmt) QueryRow(args ...any) *sql.Row
- func (this *Stmt) QueryRowContext(ctx context.Context, args ...any) *sql.Row
Constants ¶
View Source
const (
SyncMode = "OFF"
)
Variables ¶
Functions ¶
func IsClosedErr ¶ added in v1.2.1
Types ¶
type Batch ¶ added in v0.5.2
type Batch struct {
// contains filtered or unexported fields
}
func (*Batch) EnableStat ¶ added in v0.5.2
type DB ¶
type DB struct {
// contains filtered or unexported fields
}
func OpenReader ¶ added in v0.6.4
func OpenWriter ¶ added in v0.6.4
func (*DB) BeginUpdating ¶ added in v1.2.1
func (*DB) EnableStat ¶
func (*DB) EndUpdating ¶ added in v1.2.1
func (this *DB) EndUpdating()
func (*DB) ExecContext ¶
func (*DB) SetMaxOpenConns ¶ added in v0.6.4
type QueryLabel ¶
type QueryLabel struct {
// contains filtered or unexported fields
}
func NewQueryLabel ¶
func NewQueryLabel(manager *QueryStatManager, query string) *QueryLabel
func (*QueryLabel) End ¶
func (this *QueryLabel) End()
type QueryStat ¶
type QueryStat struct { Query string CostMin float64 CostMax float64 CostTotal float64 Calls int64 }
func NewQueryStat ¶
type QueryStatManager ¶
type QueryStatManager struct {
// contains filtered or unexported fields
}
func NewQueryStatManager ¶
func NewQueryStatManager() *QueryStatManager
func (*QueryStatManager) AddCost ¶
func (this *QueryStatManager) AddCost(query string, cost float64)
func (*QueryStatManager) AddQuery ¶
func (this *QueryStatManager) AddQuery(query string) *QueryLabel
func (*QueryStatManager) TopN ¶
func (this *QueryStatManager) TopN(n int) []*QueryStat
type Stmt ¶
type Stmt struct {
// contains filtered or unexported fields
}
func (*Stmt) EnableStat ¶
func (this *Stmt) EnableStat()
func (*Stmt) ExecContext ¶
func (*Stmt) QueryContext ¶
Click to show internal directories.
Click to hide internal directories.