📄️ 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 one 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:
📄️ Expression
ZModel provides an expression system that allows you to construct complex computations from primitive constructs like literals and fields. Expressions are used extensively in defining access control policies and input validation rules.
📄️ Import
ZModel allows to import other ZModel files. This is useful when you want to split your schema into multiple files for better organization.
📄️ Input Validation
This document describes the attributes and functions available for input validation in ZModel. See Input Validation for more details on how to use them.
📄️ Plugin
Plugins allow you to extend the ZModel language and add custom code generation logic.