ReferenceAnnotations
Annotations
Reference table of the annotations Credible reads in a Malloy model, what each one does, where it goes, and the page that covers it
Annotations are lines in a Malloy model that start with #, placed directly above the source, field or file they apply to. Credible reads the annotations below when you publish and when it answers a query.
| Annotation | What it does | Where it goes | See |
|---|---|---|---|
#(doc) | Describes what a source or field means, for people and agents | Above a source, dimension, measure or view | Descriptions and Value Search |
#(index) | Indexes a dimension's distinct values, so a question can find the field by a value it holds | Above a dimension | Value Indexing |
#(authorize) | Decides who can query the source. Anyone else is refused | Above a source | Row and Column Access |
#(access_filter) | Decides which rows each caller sees | Above a source | Row and Column Access |
#(secure) | Marks a given as secure: Credible fills it from the caller's identity and ignores any value the caller sends. Access rules read secure givens | Above a given in the file's given: block (the file needs ##! experimental.givens) | Row and Column Access |
#@ persist | Builds the source as a table and answers its queries from it. #@ -persist makes a source that reads a materialized source compute live instead | Above a source defined as a query (->) | Materialized Tables |
#@ preaggregate | Keeps a rolled-up copy of a measure at the grain you name, and answers coarse queries from it. #@ -preaggregate clears the grains declared above it | Above a measure | Pre-Aggregations |
The #(materialize) and #(preaggregate) annotations in recent Malloy Publisher documentation are not available in Credible yet. A model that uses them compiles, and those sources and measures are answered live. Use #@ persist and #@ preaggregate.