Documentation ¶
Index ¶
- Variables
- func Drop(_ string) error
- func DumpSchema(_ string) error
- func Migrate(_ string) error
- func MustConnectOnce()
- func Rollback(_ string) error
- func WalCleanup(_ string) error
- type DbWrapper
- func (db DbWrapper) Close() error
- func (db DbWrapper) ExecContext(ctx context.Context, query string, args ...any) (sql.Result, error)
- func (db DbWrapper) QueryContext(ctx context.Context, query string, args ...any) (*sql.Rows, error)
- func (db DbWrapper) QueryRowContext(ctx context.Context, query string, args ...any) *sql.Row
- func (db DbWrapper) QueryRowxContext(ctx context.Context, query string, args ...any) *sqlx.Row
- func (db DbWrapper) SelectContext(ctx context.Context, dest any, query string, args ...any) error
- func (db DbWrapper) Transaction(ctx context.Context, fn func(tx *sqlx.Tx) error) error
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrDropFailed = errors.New("failed to run database rollback")
View Source
var ErrMigrationFailed = errors.New("failed to run database migration")
View Source
var ErrRollbackFailed = errors.New("failed to run database rollback")
Functions ¶
func DumpSchema ¶
func MustConnectOnce ¶
func MustConnectOnce()
func WalCleanup ¶
Types ¶
type DbWrapper ¶
type DbWrapper struct {
// contains filtered or unexported fields
}
var Db DbWrapper
func (DbWrapper) ExecContext ¶
func (DbWrapper) QueryContext ¶
func (DbWrapper) QueryRowContext ¶
func (DbWrapper) QueryRowxContext ¶
func (DbWrapper) SelectContext ¶
Click to show internal directories.
Click to hide internal directories.