Documentation
¶
Index ¶
- type DB
- func (d *DB) BeginTx(ctx context.Context, opts *sql.TxOptions) (Tx, error)
- func (d *DB) Exec(query string, args ...interface{}) (sql.Result, error)
- func (d *DB) ExecContext(ctx context.Context, query string, args ...any) (sql.Result, error)
- func (d *DB) Query(query string, args ...interface{}) (*sql.Rows, error)
- func (d *DB) QueryContext(ctx context.Context, query string, args ...any) (*sql.Rows, error)
- func (d *DB) QueryRow(query string, args ...interface{}) *sql.Row
- func (d *DB) QueryRowContext(ctx context.Context, query string, args ...any) *sql.Row
- func (d *DB) SetLogger(l logger.Logger)
- type QueryLogger
- type QueryRunner
- type Tx
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DB ¶
type DB struct {
// contains filtered or unexported fields
}
func New ¶
func New(conn QueryRunner) *DB
func (*DB) ExecContext ¶
func (*DB) QueryContext ¶
func (*DB) QueryRowContext ¶
type QueryLogger ¶
type QueryRunner ¶
type QueryRunner interface { QueryRow(query string, args ...interface{}) *sql.Row Query(query string, args ...interface{}) (*sql.Rows, error) Exec(query string, args ...interface{}) (sql.Result, error) QueryContext(ctx context.Context, query string, args ...any) (*sql.Rows, error) QueryRowContext(ctx context.Context, query string, args ...any) *sql.Row ExecContext(ctx context.Context, query string, args ...any) (sql.Result, error) }
type Tx ¶
type Tx interface { QueryRunner Commit() error Rollback() error }
Click to show internal directories.
Click to hide internal directories.