Documentation ¶
Index ¶
- Variables
- func Create[ModelT any](ctx context.Context, db bun.IDB, model *ModelT, befores []hook.Before[ModelT], ...) error
- func Delete[ModelT any](ctx context.Context, db bun.IDB, model *ModelT, ...) error
- func Find[ModelT any](ctx context.Context, db bun.IDB, queryFn func(q *bun.SelectQuery)) ([]*ModelT, error)
- func FindByID[ModelT any](ctx context.Context, db bun.IDB, id any, queryFn func(q *bun.SelectQuery)) (*ModelT, error)
- func FindByIDForUpdate[ModelT any](ctx context.Context, db bun.IDB, id any, skipLocked bool, ...) (*ModelT, error)
- func FindFirst[ModelT any](ctx context.Context, db bun.IDB, queryFn func(q *bun.SelectQuery)) (*ModelT, error)
- func SelectForUpdateQuery[ModelT any](ctx context.Context, db bun.IDB, model *ModelT, skipLocked bool) (*bun.SelectQuery, *schema.Table, error)
- func SelectQuery[ModelT any](ctx context.Context, db bun.IDB, model *ModelT) (*bun.SelectQuery, *schema.Table, error)
- func Trx(ctx context.Context, db bun.IDB, ...) error
- func Update[ModelT any](ctx context.Context, db bun.IDB, model *ModelT, befores []hook.Before[ModelT], ...) error
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrModelNotStruct = errors.New("model must be a pointer to a struct")
View Source
var ErrModelNotStructOrSlice = errors.New("model must be a struct or a slice")
View Source
var ErrOnePrimaryKey = errors.New("table must have exactly one primary key")
View Source
var ErrUpdateNotExists = errors.New("model to be updated does not exist")
Functions ¶
func FindByIDForUpdate ¶
func SelectForUpdateQuery ¶
func SelectQuery ¶
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.