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) GetRowByKey(ctx context.Context, tableName string, key interface{}, row interface{}) error
- func (d *Database) HardDeleteByKey(ctx context.Context, tableName string, key interface{}, row interface{}) error
- func (d *Database) InsertRow(ctx context.Context, execer sqlx.ExecerContext, tableName string, ...) error
- func (d *Database) SelectRows(ctx context.Context, tableName string, filters interface{}, result interface{}) error
- func (d *Database) UpdateRow(ctx context.Context, execer sqlx.ExecerContext, ID string, version uint64, ...) 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 ¶
func (*Database) GetRowByKey ¶
func (*Database) HardDeleteByKey ¶
func (*Database) SelectRows ¶
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.