Crecto::Modelclass imposes the
inheritedwhich imports the correct schema modules and sets up class wide variables and constants used for keeping track of associations and field names.
schema "users", primary_key: false do
fieldmacro. The field macro takes 2 arguments, the column name as a Symbol and the column type, and an optional options tuple.
Jsonfields can be both postgres
jsonbis used, those fields can be queried using build-in postgres methods.
nil, in the case that you are using a
NOT NULLdatabase constraint you can use the non-nillable attribute accessors.
CAUTION: Mis-use of this could lead to Nil reference runtime exceptions