Data Modeling
Introduction
To power PromptQL, Hasura DDN defines your API schema declaratively. An approach that centralizes all your data collections, operations, relationships, and permissions in one place. This makes it easy to organize, modify, secure, reason about, and grow the schema which represents your API which is is accessed via PromptQL.
Lifecycle
PromptQL uses Hasura DDN to define your API schema.
Hasura DDN uses data connectors to connect to your data sources.
Data connectors introspect the source to understand the source schema.
The DDN CLI uses the introspection results to generate the API schema metadata objects. This can also be done manually.
The metadata is then "built" by the DDN CLI into a format which the Hasura engine can use to provide information to PromptQL.

Metadata Objects
There are many types of metadata objects which define your API, but the most important ones which form the backbone of your API are:
- Models which read data
- Commands which modify data
- Relationships which connect data
- Permissions which protect data
We will cover each of these in more detail in the following sections.