Versions in this module Expand all Collapse all v0 v0.0.1 Nov 4, 2024 Changes in this version + var ErrInsertConflict = errors.New("insert conflict") + var ErrInternal = errors.New("internal error") + var ErrRecordNotFound = errors.New("record not found") + func MySQLErrHandler(err error) error + func SQLiteErrHandler(err error) error + type Database struct + DB *sqlx.DB + func NewDatabase(db *sqlx.DB, opts ...Option) 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 func(error) error + type Migration struct + Down string + Up string + Version int + type Option func(*Database) + func WithErrHandler(errHandler ErrHandler) Option