Versions in this module Expand all Collapse all v1 v1.4.4 Nov 9, 2022 v1.4.3 Nov 9, 2022 Changes in this version + var ErrNotFound = sql.ErrNoRows + var ErrNotMatchDestination = errors.New("not matching destination to scan") + var ErrNotReadableValue = errors.New("value not addressable or interfaceable") + var ErrNotSettable = errors.New("passed in variable is not settable") + var ErrUnsupportedValueType = errors.New("unsupported unmarshal type") + func DisableLog() + func DisableStmtLog() + func SetSlowThreshold(threshold time.Duration) + type BulkInserter struct + func NewBulkInserter(sqlConn SqlConn, stmt string) (*BulkInserter, error) + func (bi *BulkInserter) Flush() + func (bi *BulkInserter) Insert(args ...interface{}) error + func (bi *BulkInserter) SetResultHandler(handler ResultHandler) + func (bi *BulkInserter) UpdateOrDelete(fn func()) + func (bi *BulkInserter) UpdateStmt(stmt string) error + type ResultHandler func(sql.Result, error) + type Session interface + Exec func(query string, args ...interface{}) (sql.Result, error) + ExecCtx func(ctx context.Context, query string, args ...interface{}) (sql.Result, error) + Prepare func(query string) (StmtSession, error) + PrepareCtx func(ctx context.Context, query string) (StmtSession, error) + QueryRow func(v interface{}, query string, args ...interface{}) error + QueryRowCtx func(ctx context.Context, v interface{}, query string, args ...interface{}) error + QueryRowPartial func(v interface{}, query string, args ...interface{}) error + QueryRowPartialCtx func(ctx context.Context, v interface{}, query string, args ...interface{}) error + QueryRows func(v interface{}, query string, args ...interface{}) error + QueryRowsCtx func(ctx context.Context, v interface{}, query string, args ...interface{}) error + QueryRowsPartial func(v interface{}, query string, args ...interface{}) error + QueryRowsPartialCtx func(ctx context.Context, v interface{}, query string, args ...interface{}) error + func NewSessionFromTx(tx *sql.Tx) Session + type SqlConn interface + RawDB func() (*sql.DB, error) + Transact func(fn func(Session) error) error + TransactCtx func(ctx context.Context, fn func(context.Context, Session) error) error + func NewMysql(datasource string, opts ...SqlOption) SqlConn + func NewSqlConn(driverName, datasource string, opts ...SqlOption) SqlConn + func NewSqlConnFromDB(db *sql.DB, opts ...SqlOption) SqlConn + type SqlOption func(*commonSqlConn) + type StmtSession interface + Close func() error + Exec func(args ...interface{}) (sql.Result, error) + ExecCtx func(ctx context.Context, args ...interface{}) (sql.Result, error) + QueryRow func(v interface{}, args ...interface{}) error + QueryRowCtx func(ctx context.Context, v interface{}, args ...interface{}) error + QueryRowPartial func(v interface{}, args ...interface{}) error + QueryRowPartialCtx func(ctx context.Context, v interface{}, args ...interface{}) error + QueryRows func(v interface{}, args ...interface{}) error + QueryRowsCtx func(ctx context.Context, v interface{}, args ...interface{}) error + QueryRowsPartial func(v interface{}, args ...interface{}) error + QueryRowsPartialCtx func(ctx context.Context, v interface{}, args ...interface{}) error