malloy-model

Build Malloy semantic models with base sources, joined sources, and computed sources.

9|Updated Feb 16, 2026
One-click install
npx skills add https://github.com/mathisdrn/orca --skill malloy-model-mathisdrn
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: malloy-model
Source: https://github.com/mathisdrn/orca/tree/main/.agents/skills/malloy-model
Command: npx skills add https://github.com/mathisdrn/orca --skill malloy-model-mathisdrn

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve? Writing Malloy semantic models by hand is error-prone: parse errors from bare dimensions, fan-out from wrong join cardinality, and inconsistent measure definitions across files. This Skill provides templates, rules, and validation workflows for authoring correct .malloy model files. ## Core Features & Use Cases - Base and Joined Source Templates: Generate one base source per table and one joined source per analytical domain, with primary keys, dimensions, measures, and access modifiers. - Parameterization and Access Control: Add runtime given: parameters, #(filter) annotations, and #(authorize) source gating for governed query access. - Advanced Modeling Patterns: Reference guides cover query-based computed sources, bridge tables for many-to-many joins, normalized 3-stage schemas, and promoting ad-hoc analysis into reusable models. - Use Case: Given a DuckDB database of orders and customers, generate a Malloy package with base sources per table, a customer_health joined source, verified join cardinality, and curated public/internal field visibility. ## Quick Start Create a Malloy model for my orders and customers tables with base sources, a joined source, and revenue measures.

Frequently Asked Questions about malloy-model

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I create a Malloy model with base and joined sources?▼

Create one base source file per table defining primary keys, dimensions, and measures, then create joined source files per analytical domain that import the base sources and declare join_one or join_many relationships. Verify join cardinality with a group_by query before writing joins.

Why does my Malloy dimension declaration cause a parse error?▼

Every dimension needs the form `name is expression`; a bare column name like `dimension: species` fails with a missing IS error. Raw columns are already queryable in group_by and select, so only declare a dimension when deriving or renaming a field.

When should I use join_one versus join_many in Malloy?▼

Use join_one for many-to-one relationships when the target key is unique, and join_many for one-to-many relationships, which is always safe. Verify uniqueness first by grouping on the foreign key and checking for counts greater than one.

What is the difference between given parameters and #(filter) in Malloy?▼

The `given:` syntax is Malloy's native runtime parameter mechanism and is preferred for new models, while `#(filter)` is the older Publisher-specific annotation that injects where clauses server-side. Keep `#(filter)` for required scoping filters and implicit system-injected filters that givens cannot cover.

How do I restrict access to a Malloy source?▼

Use the `#(authorize)` annotation with an expression over declared givens; Publisher evaluates it before running the query and returns 403 if no expression is true. Note that givens are caller-asserted, so authorization is only a real boundary behind a trusted tier that sets them.