Documentation
¶
Index ¶
- Variables
- func MySQLErrHandler(err error) error
- func SQLiteErrHandler(err error) error
- type Database
- func (d *Database) ApplyMigrations(schemaMigrations []Migration) error
- func (d *Database) Delete(ctx context.Context, tableName string, key interface{}) error
- func (d *Database) Get(ctx context.Context, tableName string, key interface{}, row interface{}) error
- func (d *Database) Insert(ctx context.Context, execer sqlx.ExecerContext, tableName string, ...) error
- func (d *Database) List(ctx context.Context, tableName string, filters interface{}, result interface{}) error
- func (d *Database) Update(ctx context.Context, execer sqlx.ExecerContext, tableName string, ...) error
- type ErrHandler
- type Migration
- type Option
Constants ¶
This section is empty.
Variables ¶
Functions ¶
func MySQLErrHandler ¶
MySQLErrHandler processes MySQL errors and returns a custom StorageError
func SQLiteErrHandler ¶
SQLiteErrHandler processes SQLite errors and returns a custom StorageError
Types ¶
type Database ¶
func (*Database) ApplyMigrations ¶
type ErrHandler ¶
type Option ¶
type Option func(*Database)
func WithErrHandler ¶
func WithErrHandler(errHandler ErrHandler) Option
Click to show internal directories.
Click to hide internal directories.