db

package
v0.0.0-...-bbc86cb Latest Latest
Warning

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

Go to latest
Published: Jul 16, 2019 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Named

func Named(name string, value interface{}) sql.NamedArg

Types

type ColumnType

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

type Conn

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

func (*Conn) BeginTx

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

func (*Conn) Close

func (c *Conn) Close() error

func (*Conn) ExecContext

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

func (*Conn) PingContext

func (c *Conn) PingContext(ctx context.Context) error

func (*Conn) PrepareContext

func (c *Conn) PrepareContext(ctx context.Context, query string) (*Stmt, error)

func (*Conn) QueryContext

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

func (*Conn) QueryRowContext

func (c *Conn) QueryRowContext(ctx context.Context, query string, args ...interface{}) *Row

type DB

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

func Open

func Open(driverName, dataSourceName string) (*DB, error)

Open a new connect

func (*DB) Begin

func (db *DB) Begin() (*Tx, error)

open transaction

func (*DB) BeginTx

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

func (*DB) Close

func (db *DB) Close() error

func (*DB) Conn

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

func (*DB) Driver

func (db *DB) Driver() driver.Driver

func (*DB) ExecContext

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

func (*DB) PingContext

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

func (*DB) PrepareContext

func (db *DB) PrepareContext(ctx context.Context, query string) (*Stmt, error)

func (*DB) QueryContext

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

func (*DB) QueryRowContext

func (db *DB) QueryRowContext(ctx context.Context, query string, args ...interface{}) *Row

func (*DB) SetConnMaxLifetime

func (db *DB) SetConnMaxLifetime(d time.Duration)

func (*DB) SetMaxIdleConns

func (db *DB) SetMaxIdleConns(n int)

func (*DB) SetMaxOpenConns

func (db *DB) SetMaxOpenConns(n int)

func (*DB) Stats

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

type IsolationLevel

type IsolationLevel sql.IsolationLevel

type Row

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

func (*Row) Scan

func (r *Row) Scan(dest ...interface{}) error

type Rows

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

func (*Rows) Close

func (rows *Rows) Close() error

func (*Rows) ColumnTypes

func (rows *Rows) ColumnTypes() ([]*ColumnType, error)

func (*Rows) Columns

func (rows *Rows) Columns() ([]string, error)

func (*Rows) Err

func (rows *Rows) Err() error

func (*Rows) Next

func (rows *Rows) Next() bool

func (*Rows) NextResultSet

func (rows *Rows) NextResultSet() bool

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) ExecContext

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

func (*Stmt) QueryContext

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

func (*Stmt) QueryRowContext

func (stmt *Stmt) QueryRowContext(ctx context.Context, args ...interface{}) *Row

type Tx

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

func (*Tx) Commit

func (tx *Tx) Commit() error

commit transaction

func (*Tx) ExecContext

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

func (*Tx) PrepareContext

func (tx *Tx) PrepareContext(ctx context.Context, query string) (*Stmt, error)

func (*Tx) QueryContext

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

func (*Tx) QueryRowContext

func (tx *Tx) QueryRowContext(ctx context.Context, query string, args ...interface{}) *Row

func (*Tx) Rollback

func (tx *Tx) Rollback() error

func (*Tx) StmtContext

func (tx *Tx) StmtContext(ctx context.Context, stmt *Stmt) *Stmt

type TxOptions

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

Jump to

Keyboard shortcuts

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