Documentation ¶
Index ¶
- Variables
- func And[T model.Model](conditions ...condition.WhereCondition[T]) condition.WhereCondition[T]
- func Delete[T model.Model](tx *gorm.DB, conditions ...condition.Condition[T]) *condition.Delete[T]
- func Not[T model.Model](conditions ...condition.WhereCondition[T]) condition.WhereCondition[T]
- func Open(dialector gorm.Dialector, opts ...gorm.Option) (*gorm.DB, error)
- func Or[T model.Model](conditions ...condition.WhereCondition[T]) condition.WhereCondition[T]
- func Query[T model.Model](tx *gorm.DB, conditions ...condition.Condition[T]) *condition.Query[T]
- func Transaction[RT any](db *gorm.DB, toExec func(*gorm.DB) (RT, error), opts ...*sql.TxOptions) (RT, error)
- func Update[T model.Model](tx *gorm.DB, conditions ...condition.Condition[T]) *condition.Update[T]
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // query ErrFieldModelNotConcerned = condition.ErrFieldModelNotConcerned ErrJoinMustBeSelected = condition.ErrJoinMustBeSelected // conditions ErrEmptyConditions = condition.ErrEmptyConditions ErrOnlyPreloadsAllowed = condition.ErrOnlyPreloadsAllowed // crud ErrMoreThanOneObjectFound = condition.ErrMoreThanOneObjectFound ErrObjectNotFound = condition.ErrObjectNotFound ErrUnsupportedByDatabase = condition.ErrUnsupportedByDatabase ErrOrderByMustBeCalled = condition.ErrOrderByMustBeCalled // preload ErrRelationNotLoaded = preload.ErrRelationNotLoaded )
Functions ¶
func And ¶
func And[T model.Model](conditions ...condition.WhereCondition[T]) condition.WhereCondition[T]
func Not ¶
func Not[T model.Model](conditions ...condition.WhereCondition[T]) condition.WhereCondition[T]
func Or ¶
func Or[T model.Model](conditions ...condition.WhereCondition[T]) condition.WhereCondition[T]
func Transaction ¶
func Transaction[RT any]( db *gorm.DB, toExec func(*gorm.DB) (RT, error), opts ...*sql.TxOptions, ) (RT, error)
Executes the function "toExec" inside a transaction The transaction is automatically rolled back in case "toExec" returns an error opts can be used to pass arguments to the transaction
Types ¶
This section is empty.
Source Files ¶
Click to show internal directories.
Click to hide internal directories.