📄️ Data Source
Every model needs to include exactly one datasource declaration, providing information on how to connect to the underlying database.
📄️ Model
Models represent the business entities of your application. A model can have zero or more mixins, and zero or more polymorphic base models.
📄️ Enum
Enums are container declarations for grouping constant identifiers. You can use them to express concepts like user roles, product categories, etc.
📄️ Type
Types provide a way to define complex data structures that are not backed by a database table. They server two purposes:
📄️ Data Field
Data fields are typed members of models and types.
📄️ Attribute
Attributes decorate fields and models and attach extra behaviors or constraints to them.
📄️ Function
Functions are used to provide values for attribute arguments, e.g., current DateTime, an auto-increment Int, etc. They can be used in place of attribute arguments, like:
📄️ Import
ZModel allows to import other ZModel files. This is useful when you want to split your schema into multiple files for better organization.
📄️ Plugin
Plugins allow you to extend the ZModel language and add custom code generation logic.