-
Notifications
You must be signed in to change notification settings - Fork 3
Models
Gabriel Francisco edited this page Jul 1, 2021
·
5 revisions
To create a model, create it with sqlier.Model
All methods passed to the Model will be available on child ModelInstances
-
Model(table baseinfo)
: Returns a new ModelInstance Object -
Model:get(string identity, function callback(table data))
: Gets one by identity -
Model:find(table filter, function callback(table data))
: Gets one by passed filters (aka{Name = "ceifa"}
) -
Model:filter(table filter, function callback(table data))
: Same asfind
, but gets many
These functions just call the driver method with themselves, see Drivers These should generally not be overwritten
Model:update(object, callback)
Model:increment(object, callback)
Model:decrement(object, callback)
Model:delete(identity, callback)
Model:insert(object, callback)
These functions should not be overwritten/used unless you know what youre doing
-
Model:database()
: Returns the database of the Model -
Model:__validate()
: Validates the schema of itself -
Model:__build(table model)
: Builds model into base datatypes