Documentation
¶
Index ¶
- type DB
- func (db *DB) BeginTx(ctx context.Context, opts *sql.TxOptions) (*Tx, error)
- func (db *DB) Close() error
- func (db *DB) Exec(query string, args ...any) (<-chan *Result, context.CancelFunc)
- func (db *DB) ExecContext(ctx context.Context, query string, args ...any) (<-chan *Result, context.CancelFunc)
- func (db *DB) Load(path string) error
- func (db *DB) Ping() error
- func (db *DB) Prepare(query string) (*Stmt, error)
- func (db *DB) PrepareContext(ctx context.Context, query string) (*Stmt, error)
- func (db *DB) Query(query string, args ...any) (<-chan *Rows, context.CancelFunc)
- func (db *DB) QueryContext(ctx context.Context, query string, args ...any) (<-chan *Rows, context.CancelFunc)
- func (db *DB) QueryRow(query string, args ...any) (<-chan *Row, context.CancelFunc)
- func (db *DB) QueryRowContext(ctx context.Context, query string, args ...any) (<-chan *Row, context.CancelFunc)
- type Result
- type Row
- type Rows
- type Stmt
- func (s *Stmt) Exec(args ...any) (<-chan *Result, context.CancelFunc)
- func (s *Stmt) ExecContext(ctx context.Context, args ...any) (<-chan *Result, context.CancelFunc)
- func (s *Stmt) Query(args ...any) (<-chan *Rows, context.CancelFunc)
- func (s *Stmt) QueryContext(ctx context.Context, args ...any) (<-chan *Rows, context.CancelFunc)
- func (s *Stmt) QueryRow(args ...any) (<-chan *Row, context.CancelFunc)
- func (s *Stmt) QueryRowContext(ctx context.Context, args ...any) (<-chan *Row, context.CancelFunc)
- type Tx
- func (tx *Tx) Commit() error
- func (tx *Tx) Exec(query string, args ...any) (<-chan *Result, context.CancelFunc)
- func (tx *Tx) ExecContext(ctx context.Context, query string, args ...any) (<-chan *Result, context.CancelFunc)
- func (tx *Tx) Prepare(query string) (*Stmt, error)
- func (tx *Tx) PrepareContext(ctx context.Context, query string) (*Stmt, error)
- func (tx *Tx) Query(query string, args ...any) (<-chan *Rows, context.CancelFunc)
- func (tx *Tx) QueryContext(ctx context.Context, query string, args ...any) (<-chan *Rows, context.CancelFunc)
- func (tx *Tx) QueryRow(query string, args ...any) (<-chan *Row, context.CancelFunc)
- func (tx *Tx) QueryRowContext(ctx context.Context, query string, args ...any) (<-chan *Row, context.CancelFunc)
- func (tx *Tx) Rollback() error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DB ¶
DB is a wrapper around sql.DB that provides asynchronous methods.
func (*DB) ExecContext ¶
func (db *DB) ExecContext(ctx context.Context, query string, args ...any) (<-chan *Result, context.CancelFunc)
ExecContext executes a query without returning any rows.
func (*DB) PrepareContext ¶
PrepareContext creates a prepared statement for later queries or executions.
func (*DB) QueryContext ¶
func (db *DB) QueryContext(ctx context.Context, query string, args ...any) (<-chan *Rows, context.CancelFunc)
QueryContext executes a query that returns rows, typically a SELECT.
func (*DB) QueryRowContext ¶
func (db *DB) QueryRowContext( ctx context.Context, query string, args ...any, ) (<-chan *Row, context.CancelFunc)
QueryRowContext executes a query that is expected to return at most one row.
type Stmt ¶
Stmt is a wrapper around sql.Stmt that provides asynchronous methods.
func (*Stmt) Exec ¶
func (s *Stmt) Exec(args ...any) (<-chan *Result, context.CancelFunc)
Exec executes a prepared statement with the given arguments without returning any rows.
func (*Stmt) ExecContext ¶
ExecContext executes a prepared statement with the given arguments without returning any rows.
func (*Stmt) Query ¶
func (s *Stmt) Query(args ...any) (<-chan *Rows, context.CancelFunc)
Query executes a prepared query statement with the given arguments.
func (*Stmt) QueryContext ¶
QueryContext executes a prepared query statement with the given arguments.
func (*Stmt) QueryRow ¶
func (s *Stmt) QueryRow(args ...any) (<-chan *Row, context.CancelFunc)
QueryRow executes a prepared query statement with the given arguments.
func (*Stmt) QueryRowContext ¶
QueryRowContext executes a prepared query statement with the given arguments.
type Tx ¶
Tx is a wrapper around sql.Tx that provides asynchronous methods.
func (*Tx) ExecContext ¶
func (tx *Tx) ExecContext(ctx context.Context, query string, args ...any) (<-chan *Result, context.CancelFunc)
ExecContext executes a query without returning any rows.
func (*Tx) PrepareContext ¶
PrepareContext creates a prepared statement for later queries or executions.
func (*Tx) QueryContext ¶
func (tx *Tx) QueryContext(ctx context.Context, query string, args ...any) (<-chan *Rows, context.CancelFunc)
QueryContext executes a query that returns rows, typically a SELECT.
func (*Tx) QueryRowContext ¶
func (tx *Tx) QueryRowContext( ctx context.Context, query string, args ...any, ) (<-chan *Row, context.CancelFunc)
QueryRowContext executes a query that is expected to return at most one row.
