Understand Trustfall core terminology
mainTrustfall uses a graph-based terminology to describe data structures and relationships. Understanding these concepts is essential for writing queries and defining schemas:
- schema: A formal description of the shape of a dataset used for validation, type-checking, and IDE auto-complete.
- vertex: A single data item (equivalent to a SQL row).
- vertex type: The shape/structure of vertices (equivalent to a SQL table).
- property: A named and typed value within a vertex (equivalent to a SQL column).
- edge: A named relationship between vertex types or specific vertices (equivalent to a SQL foreign key).
- entrypoint: A specific starting point for queries in a schema. Unlike SQL, Trustfall uses entrypoints to model data source restrictions (e.g., when you cannot enumerate all items in a dataset, you must start from a specific entrypoint).
- adapter: A plugin that connects the Trustfall query interpreter to an underlying data source (API, database, file, etc.).
- directive: A query component prefixed with
@(e.g.,@filter,@output) used to describe operations like filtering or transforming data.