Versions in this module Expand all Collapse all v1 v1.0.1 Nov 5, 2023 v1.0.0 Nov 5, 2023 Changes in this version + var ErrNoRows = errors.New("sql: no rows in result set") + var ErrTxDone = errors.New("sql: Transaction has already been committed or rolled back") + func Drivers() []string + func Register(name string, driver driver.Driver) + func RegisterByOctillery(name string, driver driver.Driver) + func SetAfterCommitCallback(successCallback func(*Tx) error, ...) + func SetBeforeCommitCallback(callback func(tx *Tx, writeQueries []*QueryLog) error) + type ColumnType struct + func (ci *ColumnType) DatabaseTypeName() string + func (ci *ColumnType) DecimalSize() (precision, scale int64, ok bool) + func (ci *ColumnType) Length() (length int64, ok bool) + func (ci *ColumnType) Name() string + func (ci *ColumnType) Nullable() (nullable, ok bool) + func (ci *ColumnType) ScanType() reflect.Type + type DB struct + func Open(driverName, dataSourceName string) (*DB, error) + 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) ConnectionManager() *connection.DBConnectionManager + func (db *DB) Driver() coredriver.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) 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) SetConnMaxLifetime(d time.Duration) + func (db *DB) SetMaxIdleConns(n int) + func (db *DB) SetMaxOpenConns(n int) + func (db *DB) Stats() DBStats + type DBStats struct + type IsolationLevel int + const LevelDefault + const LevelLinearizable + const LevelReadCommitted + const LevelReadUncommitted + const LevelRepeatableRead + const LevelSerializable + const LevelSnapshot + const LevelWriteCommitted + type NamedArg struct + Name string + Value interface{} + func Named(name string, value interface{}) NamedArg + type NullBool struct + Bool bool + Valid bool + func (n *NullBool) Scan(value interface{}) error + func (n NullBool) Value() (driver.Value, error) + type NullFloat64 struct + Float64 float64 + Valid bool + func (n *NullFloat64) Scan(value interface{}) error + func (n NullFloat64) Value() (driver.Value, error) + type NullInt32 struct + Int32 int32 + Valid bool + func (n *NullInt32) Scan(value interface{}) error + func (n NullInt32) Value() (driver.Value, error) + type NullInt64 struct + Int64 int64 + Valid bool + func (n *NullInt64) Scan(value interface{}) error + func (n NullInt64) Value() (driver.Value, error) + type NullString struct + String string + Valid bool + func (ns *NullString) Scan(value interface{}) error + func (ns NullString) Value() (driver.Value, error) + type NullTime struct + Time time.Time + Valid bool + func (n *NullTime) Scan(value interface{}) error + func (n NullTime) Value() (driver.Value, error) + type QueryLog struct + Args []interface{} + LastInsertID int64 + Query string + type RawBytes []byte + type Result interface + LastInsertId func() (int64, error) + RowsAffected func() (int64, error) + type Row struct + func (r *Row) Scan(dest ...interface{}) error + type Rows struct + func (rs *Rows) Close() error + func (rs *Rows) ColumnTypes() ([]*ColumnType, 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 + type Scanner interface + Scan func(src interface{}) error + type Stmt struct + func (s *Stmt) Close() error + func (s *Stmt) Exec(args ...interface{}) (core.Result, error) + func (s *Stmt) ExecContext(ctx context.Context, args ...interface{}) (core.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 + type Tx struct + func (proxy *Tx) AfterCommitCallback(success func() error, failure func(bool, []*QueryLog) error) + func (proxy *Tx) BeforeCommitCallback(callback func([]*QueryLog) error) + func (proxy *Tx) Commit() error + func (proxy *Tx) Exec(query string, args ...interface{}) (Result, error) + func (proxy *Tx) ExecContext(ctx context.Context, query string, args ...interface{}) (Result, error) + func (proxy *Tx) Prepare(query string) (*Stmt, error) + func (proxy *Tx) PrepareContext(ctx context.Context, query string) (*Stmt, error) + func (proxy *Tx) Query(query string, args ...interface{}) (*Rows, error) + func (proxy *Tx) QueryContext(ctx context.Context, query string, args ...interface{}) (*Rows, error) + func (proxy *Tx) QueryRow(query string, args ...interface{}) *Row + func (proxy *Tx) QueryRowContext(ctx context.Context, query string, args ...interface{}) *Row + func (proxy *Tx) ReadQueries() []*connection.QueryLog + func (proxy *Tx) Rollback() error + func (proxy *Tx) Stmt(stmt *Stmt) *Stmt + func (proxy *Tx) StmtContext(ctx context.Context, stmt *Stmt) *Stmt + func (proxy *Tx) WriteQueries() []*connection.QueryLog + func (t *Tx) ConvertWriteQueryIntoCountQuery(query sqlparser.Query) (sqlparser.Query, error) + func (t *Tx) ExecWithQueryLog(log *QueryLog) (Result, error) + func (t *Tx) GetParsedQueryByQueryLog(log *QueryLog) (sqlparser.Query, error) + func (t *Tx) IsAlreadyCommittedQueryLog(log *QueryLog) (bool, error) + type TxOptions struct + Isolation IsolationLevel + ReadOnly bool