Documentation ¶
Overview ¶
package nest supports nested transactions allowing a common querier to be defined.
Index ¶
- type Conn
- func (c *Conn) BeginTx(ctx context.Context, opts *TxOptions) (*Tx, error)
- func (c *Conn) Commit() error
- func (c *Conn) Conn() *sql.Conn
- func (c *Conn) ExecContext(ctx context.Context, query string, args ...interface{}) (Result, error)
- func (c *Conn) PingContext(ctx context.Context) error
- func (c *Conn) PrepareContext(ctx context.Context, query string) (*Stmt, error)
- func (c *Conn) QueryContext(ctx context.Context, query string, args ...interface{}) (*Rows, error)
- func (c *Conn) QueryRowContext(ctx context.Context, query string, args ...interface{}) *Row
- func (c *Conn) Rollback() error
- type DB
- func (db *DB) BeginTx(ctx context.Context, opts *TxOptions) (*Tx, error)
- func (db *DB) Commit() error
- func (db *DB) DB() *sql.DB
- func (db *DB) ExecContext(ctx context.Context, query string, args ...interface{}) (Result, error)
- func (db *DB) PingContext(ctx context.Context) error
- func (db *DB) PrepareContext(ctx context.Context, query string) (*Stmt, error)
- func (db *DB) QueryContext(ctx context.Context, query string, args ...interface{}) (*Rows, error)
- func (db *DB) QueryRowContext(ctx context.Context, query string, args ...interface{}) *Row
- func (db *DB) Rollback() error
- type Querier
- type Result
- type Row
- type Rows
- type Stmt
- type Tx
- func (tx *Tx) BeginTx(ctx context.Context, opts *TxOptions) (*Tx, error)
- func (tx *Tx) Commit() error
- func (tx *Tx) ExecContext(ctx context.Context, query string, args ...interface{}) (Result, error)
- func (tx *Tx) PingContext(ctx context.Context) error
- func (tx *Tx) PrepareContext(ctx context.Context, query string) (*Stmt, error)
- func (tx *Tx) QueryContext(ctx context.Context, query string, args ...interface{}) (*Rows, error)
- func (tx *Tx) QueryRowContext(ctx context.Context, query string, args ...interface{}) *Row
- func (tx *Tx) Rollback() error
- func (tx *Tx) Tx() *sql.Tx
- type TxOptions
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Conn ¶
type Conn struct {
// contains filtered or unexported fields
}
func (*Conn) ExecContext ¶
func (*Conn) PrepareContext ¶
func (*Conn) QueryContext ¶
func (*Conn) QueryRowContext ¶
type DB ¶
type DB struct {
// contains filtered or unexported fields
}
func (*DB) ExecContext ¶
func (*DB) PrepareContext ¶
func (*DB) QueryContext ¶
func (*DB) QueryRowContext ¶
type Querier ¶
type Querier interface { ExecContext(ctx context.Context, query string, args ...interface{}) (sql.Result, error) QueryContext(ctx context.Context, query string, args ...interface{}) (*sql.Rows, error) QueryRowContext(ctx context.Context, query string, args ...interface{}) *sql.Row PingContext(ctx context.Context) error PrepareContext(ctx context.Context, query string) (*Stmt, error) Commit() error Rollback() error }
Querier is the common interface to execute queries on a DB, Tx, or Conn.
type Tx ¶
type Tx struct {
// contains filtered or unexported fields
}
func (*Tx) ExecContext ¶
func (*Tx) PrepareContext ¶
func (*Tx) QueryContext ¶
func (*Tx) QueryRowContext ¶
Click to show internal directories.
Click to hide internal directories.