Documentation ¶
Index ¶
- Variables
- func Drivers() []string
- func Register(name string, driver driver.Driver)
- type DB
- func (db *DB) Begin() (*Tx, error)
- func (db *DB) BeginTx(ctx context.Context, opts *TxOptions) (*Tx, error)
- func (db *DB) Close() error
- func (db *DB) Driver() driver.Driver
- func (db *DB) Exec(query string, args ...interface{}) (Result, error)
- func (db *DB) ExecContext(ctx context.Context, query string, args ...interface{}) (Result, error)
- func (db *DB) Insert(tableName string, structSlice interface{}) (Result, error)
- func (db *DB) InsertContext(ctx context.Context, tableName string, structSlice interface{}) (Result, error)
- func (db *DB) Ping() error
- func (db *DB) PingContext(ctx context.Context) 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 ...interface{}) (*Rows, error)
- func (db *DB) QueryContext(ctx context.Context, query string, args ...interface{}) (*Rows, error)
- func (db *DB) QueryRow(query string, args ...interface{}) *Row
- func (db *DB) QueryRowContext(ctx context.Context, query string, args ...interface{}) *Row
- func (db *DB) SelectToMap(query string, args ...interface{}) ([]map[string]string, error)
- func (db *DB) SelectToMapContext(ctx context.Context, query string, args ...interface{}) ([]map[string]string, error)
- func (db *DB) SelectToSlice(query string, args ...interface{}) ([][]string, error)
- func (db *DB) SelectToSliceContext(ctx context.Context, query string, args ...interface{}) ([][]string, error)
- func (db *DB) SelectToStruct(structSlicePtr interface{}, query string, args ...interface{}) error
- func (db *DB) SelectToStructContext(ctx context.Context, structSlicePtr interface{}, query string, ...) error
- func (db *DB) SetConnMaxIdleTime(d time.Duration)
- func (db *DB) SetConnMaxLifetime(d time.Duration)
- func (db *DB) SetMaxIdleConns(n int)
- func (db *DB) SetMaxOpenConns(n int)
- func (db *DB) Stats() DBStats
- type DBStats
- type IsolationLevel
- type NullBool
- type NullFloat64
- type NullInt32
- type NullInt64
- type NullString
- type NullTime
- type RawBytes
- type Result
- type Row
- type Rows
- func (rs *Rows) Close() error
- func (rs *Rows) ColumnTypes() ([]*columnTypes, error)
- func (rs *Rows) Columns() ([]string, error)
- func (rs *Rows) Err() error
- func (rs *Rows) Next() bool
- func (rs *Rows) NextResultSet() bool
- func (rs *Rows) Scan(dest ...interface{}) error
- func (rs *Rows) ScanToMap() (map[string]string, error)
- func (rs *Rows) ScanToSlice() ([]string, error)
- func (rs *Rows) ScanToStruct(structPtr interface{}) error
- type Stmt
- func (s *Stmt) Close() error
- func (s *Stmt) Exec(args ...interface{}) (Result, error)
- func (s *Stmt) ExecContext(ctx context.Context, args ...interface{}) (Result, error)
- func (s *Stmt) Query(args ...interface{}) (*Rows, error)
- func (s *Stmt) QueryContext(ctx context.Context, args ...interface{}) (*Rows, error)
- func (s *Stmt) QueryRow(args ...interface{}) *Row
- func (s *Stmt) QueryRowContext(ctx context.Context, args ...interface{}) *Row
- func (s *Stmt) SelectToMap(args ...interface{}) ([]map[string]string, error)
- func (s *Stmt) SelectToMapContext(ctx context.Context, args ...interface{}) ([]map[string]string, error)
- func (s *Stmt) SelectToSlice(args ...interface{}) ([][]string, error)
- func (s *Stmt) SelectToSliceContext(ctx context.Context, args ...interface{}) ([][]string, error)
- func (s *Stmt) SelectToStruct(structSlicePtr interface{}, args ...interface{}) error
- func (s *Stmt) SelectToStructContext(ctx context.Context, structSlicePtr interface{}, args ...interface{}) error
- type Tx
- func (tx *Tx) Commit() error
- func (tx *Tx) Exec(query string, args ...interface{}) (Result, error)
- func (tx *Tx) ExecContext(ctx context.Context, query string, args ...interface{}) (Result, error)
- func (tx *Tx) Insert(tableName string, structSlice interface{}) (Result, error)
- func (tx *Tx) InsertContext(ctx context.Context, tableName string, structSlice interface{}) (Result, error)
- 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 ...interface{}) (*Rows, error)
- func (tx *Tx) QueryContext(ctx context.Context, query string, args ...interface{}) (*Rows, error)
- func (tx *Tx) QueryRow(query string, args ...interface{}) *Row
- func (tx *Tx) QueryRowContext(ctx context.Context, query string, args ...interface{}) *Row
- func (tx *Tx) Rollback() error
- func (tx *Tx) SelectToMap(query string, args ...interface{}) ([]map[string]string, error)
- func (tx *Tx) SelectToMapContext(ctx context.Context, query string, args ...interface{}) ([]map[string]string, error)
- func (tx *Tx) SelectToSlice(query string, args ...interface{}) ([][]string, error)
- func (tx *Tx) SelectToSliceContext(ctx context.Context, query string, args ...interface{}) ([][]string, error)
- func (tx *Tx) SelectToStruct(structSlicePtr interface{}, query string, args ...interface{}) error
- func (tx *Tx) SelectToStructContext(ctx context.Context, structSlicePtr interface{}, query string, ...) error
- type TxOptions
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrConnDone = sql.ErrConnDone ErrNoRows = sql.ErrNoRows ErrTxDone = sql.ErrTxDone )
Functions ¶
Types ¶
type DB ¶
func (*DB) ExecContext ¶
func (*DB) InsertContext ¶
func (*DB) PrepareContext ¶
func (*DB) QueryContext ¶
func (*DB) QueryRowContext ¶
func (*DB) SelectToMap ¶
func (*DB) SelectToMapContext ¶
func (*DB) SelectToSlice ¶
func (*DB) SelectToSliceContext ¶
func (*DB) SelectToStruct ¶
func (*DB) SelectToStructContext ¶
func (*DB) SetConnMaxIdleTime ¶ added in v0.2.0
func (*DB) SetConnMaxLifetime ¶
func (*DB) SetMaxIdleConns ¶
func (*DB) SetMaxOpenConns ¶
type IsolationLevel ¶
type IsolationLevel = sql.IsolationLevel
const ( LevelDefault IsolationLevel = iota LevelReadUncommitted LevelReadCommitted LevelWriteCommitted LevelRepeatableRead LevelSnapshot LevelSerializable LevelLinearizable )
type NullFloat64 ¶
type NullFloat64 = sql.NullFloat64
type NullString ¶
type NullString = sql.NullString
type Result ¶
type Result struct {
// contains filtered or unexported fields
}
func (Result) LastInsertId ¶
func (Result) RowsAffected ¶
type Row ¶
type Row struct {
// contains filtered or unexported fields
}
func (*Row) ScanToSlice ¶
func (*Row) ScanToStruct ¶
type Rows ¶
func (*Rows) ColumnTypes ¶
func (*Rows) NextResultSet ¶
func (*Rows) ScanToSlice ¶
func (*Rows) ScanToStruct ¶
type Stmt ¶
func (*Stmt) ExecContext ¶
func (*Stmt) QueryContext ¶
func (*Stmt) QueryRowContext ¶
func (*Stmt) SelectToMap ¶
func (*Stmt) SelectToMapContext ¶
func (*Stmt) SelectToSlice ¶
func (*Stmt) SelectToSliceContext ¶
func (*Stmt) SelectToStruct ¶
type Tx ¶
func (*Tx) ExecContext ¶
func (*Tx) InsertContext ¶
func (*Tx) PrepareContext ¶
func (*Tx) QueryContext ¶
func (*Tx) QueryRowContext ¶
func (*Tx) SelectToMap ¶
func (*Tx) SelectToMapContext ¶
func (*Tx) SelectToSlice ¶
func (*Tx) SelectToSliceContext ¶
func (*Tx) SelectToStruct ¶
Source Files ¶
Click to show internal directories.
Click to hide internal directories.