package nest
import "github.com/golang-sql/sqlexp/nest"
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 Wrap(db *sql.DB) *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
Types ¶
type Conn ¶
type Conn struct {
// contains filtered or unexported fields
}
func (*Conn) BeginTx ¶
func (*Conn) Commit ¶
func (*Conn) Conn ¶
func (*Conn) ExecContext ¶
func (*Conn) PingContext ¶
func (*Conn) PrepareContext ¶
func (*Conn) QueryContext ¶
func (*Conn) QueryRowContext ¶
func (*Conn) Rollback ¶
type DB ¶
type DB struct {
// contains filtered or unexported fields
}
func Wrap ¶
Wrap a sql.DB with a nestable DB.
func (*DB) BeginTx ¶
func (*DB) Commit ¶
func (*DB) DB ¶
func (*DB) ExecContext ¶
func (*DB) PingContext ¶
func (*DB) PrepareContext ¶
func (*DB) QueryContext ¶
func (*DB) QueryRowContext ¶
func (*DB) Rollback ¶
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 Result ¶
type Row ¶
type Rows ¶
type Stmt ¶
type Tx ¶
type Tx struct {
// contains filtered or unexported fields
}
func (*Tx) BeginTx ¶
func (*Tx) Commit ¶
func (*Tx) ExecContext ¶
func (*Tx) PingContext ¶
func (*Tx) PrepareContext ¶
func (*Tx) QueryContext ¶
func (*Tx) QueryRowContext ¶
func (*Tx) Rollback ¶
func (*Tx) Tx ¶
type TxOptions ¶
Source Files ¶
- Version
- v0.1.0 (latest)
- Published
- May 18, 2022
- Platform
- windows/amd64
- Imports
- 6 packages
- Last checked
- 3 hours ago –
Tools for package owners.