Documentation
¶
Overview ¶
Package sqler wraps database/sql in interfaces.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Conn ¶
type DB ¶
type DB interface {
Conn
SetConnMaxLifetime(d time.Duration)
SetMaxIdleConns(n int)
SetMaxOpenConns(n int)
Stats() sql.DBStats
Unwrap() *sql.DB
}
type Queryer ¶
type Queryer interface {
Exec(ctx context.Context, query string, args ...interface{}) (sql.Result, error)
Prepare(ctx context.Context, query string) (Stmt, error)
Query(ctx context.Context, query string, args ...interface{}) (Rows, error)
QueryRow(ctx context.Context, query string, args ...interface{}) Row
}
func WrapQueryer ¶
func WrapQueryer(q SQLQueryer) Queryer
type SQLConn ¶
type SQLConn interface {
SQLQueryer
BeginTx(ctx context.Context, opts *sql.TxOptions) (*sql.Tx, error)
Close() error
PingContext(ctx context.Context) error
}
SQLConn is the common interface of *sql.DB and *sql.Conn.
type SQLQueryer ¶
type SQLQueryer interface {
ExecContext(ctx context.Context, query string, args ...interface{}) (sql.Result, error)
PrepareContext(ctx context.Context, query string) (*sql.Stmt, error)
QueryContext(ctx context.Context, query string, args ...interface{}) (*sql.Rows, error)
QueryRowContext(ctx context.Context, query string, args ...interface{}) *sql.Row
}
SQLQueryer is the common interface of *sql.DB, *sql.Conn and *sql.Tx.
Click to show internal directories.
Click to hide internal directories.