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.

AnnotationWhat it doesWhere it goesSee
#(doc)Describes what a source or field means, for people and agentsAbove a source, dimension, measure or viewDescriptions and Value Search
#(index)Indexes a dimension's distinct values, so a question can find the field by a value it holdsAbove a dimensionValue Indexing
#(authorize)Decides who can query the source. Anyone else is refusedAbove a sourceRow and Column Access
#(access_filter)Decides which rows each caller seesAbove a sourceRow 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 givensAbove a given in the file's given: block (the file needs ##! experimental.givens)Row and Column Access
#@ persistBuilds the source as a table and answers its queries from it. #@ -persist makes a source that reads a materialized source compute live insteadAbove a source defined as a query (->)Materialized Tables
#@ preaggregateKeeps a rolled-up copy of a measure at the grain you name, and answers coarse queries from it. #@ -preaggregate clears the grains declared above itAbove a measurePre-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.

Next Steps