module Crorm::Model
Defined in:
crorm/model.crMacro Summary
-
field(decl, key = nil, converter = nil, pkey = false, auto = false, json_ignore = false)
Defines a field decl with the given options.
- schema(table, dialect = :sqlite, strict = true, multi = false, json = true)
-
timestamps
include created_at and updated_at that will automatically be updated
Instance Method Summary
- #db_changes(skip_fields : Enumerable(String))
- #db_changes
- #db_values
- #insert!(query : String = @@schema.insert_stmt, args_ = self.db_values, db : DB_ = self.class.db)
- #pk_values
- #update!(query : String = @@schema.update_stmt, args_ = self.update_values, db : DB_ = self.class.db)
- #update_values
- #upsert!(query : String = @@schema.upsert_stmt, args_ = self.db_values, db : DB_ = self.class.db)
Macro Detail
Defines a field decl with the given options.
Instance Method Detail
def insert!(query : String = @@schema.insert_stmt, args_ = self.db_values, db : DB_ = self.class.db)
#
def update!(query : String = @@schema.update_stmt, args_ = self.update_values, db : DB_ = self.class.db)
#