sql

package
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 9, 2021 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

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 NewConn

func NewConn(conn *sql.Conn, core *kra.Core) *Conn

func (*Conn) Begin

func (conn *Conn) Begin(ctx context.Context) (*Tx, error)

func (*Conn) BeginTx

func (conn *Conn) BeginTx(ctx context.Context, opts *sql.TxOptions) (*Tx, error)

func (*Conn) Close

func (conn *Conn) Close() error

func (*Conn) Conn

func (conn *Conn) Conn() *sql.Conn

func (*Conn) Exec

func (conn *Conn) Exec(ctx context.Context, query string, args ...interface{}) (sql.Result, error)

func (*Conn) Find

func (conn *Conn) Find(ctx context.Context, dest interface{}, query string, args ...interface{}) error

func (*Conn) FindAll

func (conn *Conn) FindAll(ctx context.Context, dest []interface{}, query string, args ...interface{}) error

func (*Conn) Ping

func (conn *Conn) Ping(ctx context.Context) error

func (*Conn) Prepare

func (conn *Conn) Prepare(ctx context.Context, query string, examples ...interface{}) (*Stmt, error)

func (*Conn) Query

func (conn *Conn) Query(ctx context.Context, query string, args ...interface{}) (*Rows, error)

type DB

type DB struct {
	// contains filtered or unexported fields
}

func NewDB

func NewDB(db *sql.DB, core *kra.Core) *DB

func Open

func Open(core *kra.Core, driverName, dataSourceName string) (*DB, error)

func (*DB) Begin

func (db *DB) Begin(ctx context.Context) (*Tx, error)

func (*DB) BeginTx

func (db *DB) BeginTx(ctx context.Context, opts *sql.TxOptions) (*Tx, error)

func (*DB) Close

func (db *DB) Close() error

func (*DB) DB

func (db *DB) DB() *sql.DB

func (*DB) Exec

func (db *DB) Exec(ctx context.Context, query string, args ...interface{}) (sql.Result, error)

func (*DB) Find

func (db *DB) Find(ctx context.Context, dest interface{}, query string, args ...interface{}) error

func (*DB) FindAll

func (db *DB) FindAll(ctx context.Context, dest interface{}, query string, args ...interface{}) error

func (*DB) Ping

func (db *DB) Ping(ctx context.Context) error

func (*DB) Prepare

func (db *DB) Prepare(ctx context.Context, query string, examples ...interface{}) (*Stmt, error)

func (*DB) Query

func (db *DB) Query(ctx context.Context, query string, args ...interface{}) (*Rows, error)

type ExecFn

type ExecFn func(context.Context, string, ...interface{}) (sql.Result, error)

type PrepareFn

type PrepareFn func(context.Context, string) (*sql.Stmt, error)

type QueryFn

type QueryFn func(ctx context.Context, query string, args ...interface{}) (*sql.Rows, error)

type Rows

type Rows struct {
	// contains filtered or unexported fields
}

func (*Rows) Close

func (rows *Rows) Close() error

func (*Rows) Rows

func (rows *Rows) Rows() *sql.Rows

func (*Rows) Scan

func (rows *Rows) Scan(dest interface{}) error

type Stmt

type Stmt struct {
	// contains filtered or unexported fields
}

func (*Stmt) Close

func (stmt *Stmt) Close() error

func (*Stmt) Exec

func (stmt *Stmt) Exec(ctx context.Context, args ...interface{}) (sql.Result, error)

func (*Stmt) Query

func (stmt *Stmt) Query(ctx context.Context, args ...interface{}) (*Rows, error)

func (*Stmt) Stmt

func (stmt *Stmt) Stmt() *sql.Stmt

type Tx

type Tx struct {
	// contains filtered or unexported fields
}

func (*Tx) Commit

func (tx *Tx) Commit() error

func (*Tx) Exec

func (tx *Tx) Exec(ctx context.Context, query string, args ...interface{}) (sql.Result, error)

func (*Tx) Find

func (tx *Tx) Find(ctx context.Context, dest interface{}, query string, args ...interface{}) error

func (*Tx) FindAll

func (tx *Tx) FindAll(ctx context.Context, dest []interface{}, query string, args ...interface{}) error

func (*Tx) Prepare

func (tx *Tx) Prepare(ctx context.Context, query string, examples ...interface{}) (*Stmt, error)

func (*Tx) Query

func (tx *Tx) Query(ctx context.Context, query string, args ...interface{}) (*Rows, error)

func (*Tx) Rollback

func (tx *Tx) Rollback() error

func (*Tx) Tx

func (tx *Tx) Tx() *sql.Tx

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL