module DBX::ORM::ModelMixin(Model, ModelQuery)
Overview
Mixin for Model
class.
Automatically injected into the models.
Defined in:
orm/model_mixin.crInstance Method Summary
-
#create!(data : Hash | NamedTuple, returning : DBX::QueryBuilder::OneOrMoreFieldsType = "*") : Model::Schema
Creates a new resource and returns.
-
#delete(pk_value) : ModelQuery
Deletes one resource by its primary key.
-
#delete : ModelQuery
Deletes one or more resources.
-
#find(pk_value) : ModelQuery
Find one resource by its primary key.
-
#find : ModelQuery
Find one or more resources.
-
#insert(data : Hash | NamedTuple) : ModelQuery
Inserts a new resource.
-
#query : ModelQuery
Creates a new
ModelQuery
instance. -
#update(pk_value, data : Hash | NamedTuple) : ModelQuery
Updates one resource by its primary key.
-
#update(data : Hash | NamedTuple) : ModelQuery
Update one or more resources.
Instance Method Detail
def create!(data : Hash | NamedTuple, returning : DBX::QueryBuilder::OneOrMoreFieldsType = "*") : Model::Schema
#
Creates a new resource and returns.
def update(pk_value, data : Hash | NamedTuple) : ModelQuery
#
Updates one resource by its primary key.