Documentation ¶
Index ¶
- Variables
- func Begin() (*sql.Tx, error)
- func BeginTx(ctx context.Context, opts *sql.TxOptions) (*sql.Tx, error)
- func CheckAffected(rslt sql.Result, sqlErr error, expected ...int) error
- func Close() error
- func Conn(ctx context.Context) (*sql.Conn, error)
- func Driver() driver.Driver
- func Exec(query string, args ...interface{}) (sql.Result, error)
- func ExecContext(ctx context.Context, query string, args ...interface{}) (sql.Result, error)
- func Init(driverName, dataSourceName string) (err error)
- func IsMySQLDuplicate(err error) bool
- func Ping() error
- func PingContext(ctx context.Context) error
- func Prepare(query string) (*sql.Stmt, error)
- func PrepareContext(ctx context.Context, query string) (*sql.Stmt, error)
- func Query(query string, args ...interface{}) (*sql.Rows, error)
- func QueryContext(ctx context.Context, query string, args ...interface{}) (*sql.Rows, error)
- func QueryRow(query string, args ...interface{}) *sql.Row
- func QueryRowContext(ctx context.Context, query string, args ...interface{}) *sql.Row
- func SetConnMaxLifetime(d time.Duration)
- func SetMaxIdleConns(n int)
- func SetMaxOpenConns(n int)
- func Stats() sql.DBStats
- type MapBool
- type MapString
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrBadAffectedCount = errors.New("bad affected count")
Functions ¶
func CheckAffected ¶
CheckAffected checks if result.RowsAffected() are equal to the expected
func ExecContext ¶
func IsMySQLDuplicate ¶
IsMySQLDuplicate checks if mysql error is ER_DUP_ENTRY mysql error
func PingContext ¶
func QueryContext ¶
func QueryRowContext ¶
func SetConnMaxLifetime ¶
func SetMaxIdleConns ¶
func SetMaxIdleConns(n int)
func SetMaxOpenConns ¶
func SetMaxOpenConns(n int)
Types ¶
Click to show internal directories.
Click to hide internal directories.