package
0.0.0-20241018081110-072913901059
Repository: https://github.com/oldmacloud/crud.git
Documentation: pkg.go.dev

# Functions

Count returns the number of models.
CountAssociations count matched associations (model.field).
Create creates a model in the database.
Delete a model from database.
DeleteByID deletes a model from database by its ID.
DeleteNested remove the association between parent and child.
DeleteNestedByID remove the association between parent and child.
FilterBy is a query option that sets WHERE field=value condition for GetMany.
Get fetch a single model T into dest.
GetAssociations find matched associations (model.field) into dest.
GetByID is a shortcut for Get[T](&T, FilterBy("id", id)) Notice: "id" here is the column (or field) name of the primary key of the model which is indicated by the Identity method of orm.Model.
GetMany returns a list of models T into dest.
IfNotExist creates a model if it does not exist.
NestInto creates a nested model of the parent model in the database.
OrderBy is a query option that sets ordering for GetMany.
Preload preloads a relationship (eager loading).
PreloadAll to Preload all associations.
Update all fields of an existing model in database.
UpdateField updates a single fields of an existing model in database.
Where offers a more flexible way to set WHERE conditions.
WithPage is a query option that sets pagination for GetMany.

# Variables

No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author

# Type aliases

CreateMode is the way to create a model: - IfNotExist: creates a model if it does not exist.
QueryOption is a function that can be used to construct a query.