Previous: Tables dependencies, Up: Models [Contents]
The model definition API:
(create-artanis-model model_name (:deps deps_list ...) fields_def ...)
The fields_def syntax is:
(field_name type (options ...))
To unify API amoung all the DB backend supported by GNU Artanis, we provide abstract types:
#:maxlen positive_integer in the options.
#:no-edit)
#:auto-now
#:auto-now-once
NOTE: if these types can’t meet your requirements, just write the known type for your configured DB backend supported types, it will be passed directly to the backend, however, without the framework specific feature like type checking.
The options has specific syntax for different DB backend.
The specific options are:
#:not-null
#:null
#:default to speficy default value.
#:unique
#:unique-key
#:primary-key
#:key to specify keys.
#:auto-incremental
#:comment for commenting.
#:column-format
#:storage mode DISK or MEMORY mode.
#:signed
#:unsigned
#:zerofill
PostgreSQL migration hasn’t been supported yet…patches are welcome.
#:not-null
#:null
#:default value
#:unique
#:unique-key
#:primary-key
#:key
#:auto-increment
#:auto-now-once for timestamp.