GrainER MODELER

Data modeling for Snowflake

Declare the grain. Ship the tables.

Grain is an entity-relationship modeler built for Snowflake warehouses. Design dimensional and Data Vault models on a diagram, compare them with what is really in Snowflake, and deploy only the statements you have read. Run it as Grain Desktop on macOS and Windows or as a VS Code extension beside your code, and soon as a Snowflake app inside your own account.

The playground opens a sample model in your browser. No sign-up, nothing to install.

LOGfact_order_lineTransaction Fact
PKorder_line_keyNUMBER
FKorder_keyNUMBER
FKproduct_keyNUMBER
FKorder_date_keyNUMBER
quantityNUMBER(9,0)
line_amountNUMBER(18,2)
etl_batch_idNUMBER
grain: one row per order line
er-model/entities/fact_order_line.ymlname: fact_order_line
pattern: transaction-fact
grain: One row per order line
attributes:
  - name: order_line_key
    type: NUMBER
    primaryKey: true
  - name: line_amount
    type: NUMBER(18,2)
    lexicon: amount
    notNull: true
Fig. 1. One row per order line, stated on the entity and kept in a plain YAML file that is always yours.
  • Three products, one modeler
  • One model, in plain YAML
  • Snowflake access as yourself
Three ways to run itSnowflake app, Grain Desktop or VS Code extension, on the same model.
Every statement shownDeploy runs nothing you haven't read, and asks again for anything destructive.
Cortex in your accountThe assistant sees your design, never the data in your tables.
11 design patternsKimball dimensions and facts, plus Data Vault hubs, links and satellites.

Three ways to run Grain

One modeler, wherever your team works.

The Snowflake app, Grain Desktop and the VS Code extension have the same features and the same diagram. They differ in where the model lives and how you sign in to Snowflake. A model moves freely between them as the same folder of YAML files.

Coming soon

Snowflake app

A Snowflake Native App, for teams who want one shared model, with nothing to install on anyone's computer.

  • Runs in a container inside your own Snowflake account
  • Opened from Snowsight, signed in as each person's Snowflake user
  • One shared model: an edit by anyone reaches every open tab
  • Installed from Snowflake Marketplace and billed on your Snowflake invoice
Preview the setup
macOS · Windows

Grain Desktop

For modelers who want the model on their own computer and in Git, without an editor.

  • For macOS, on Apple silicon and Intel, and Windows
  • The model is an er-model folder of YAML files on your computer
  • Git from the app: connect, clone, commit, pull and push
  • Connects to Snowflake as you, with a token or single sign-on kept encrypted by the system
See how to start
Visual Studio Code

VS Code extension

For analytics engineers who model beside their code and dbt project.

  • Works inside Visual Studio Code, in the folder you already have open
  • The model is YAML in your workspace, reviewed in pull requests
  • Edits to the YAML in a text editor or a Git checkout show up on the diagram
  • Connects with your own token or single sign-on, kept in VS Code's secret storage
See how to start

Grain Desktop and the VS Code extension are in early access, free; the Snowflake app is coming soon to Snowflake Marketplace. Compare them side by side, or tell us which you'd like to use.

The problem

Most warehouses are modeled twice, and the two never agree.

There is the diagram someone drew at the start, and the DDL that actually ran. Within a quarter they drift apart, and the glossary lives in a third place nobody links to. Grain keeps one model, checks it against Snowflake, and keeps the business meaning attached to the columns.

Drift

The diagram stops matching production

Grain reads the live schema and lists every difference column by column: missing tables, type changes, NOT NULL, keys. You choose, per difference, whether the design or Snowflake is right.

Risk

DDL goes out without a real review

Grain writes CREATE for new tables and ALTER for existing ones, flags anything destructive, and refuses type changes Snowflake can't make safely. Nothing runs until each statement is ticked.

Meaning

Definitions live somewhere else

Link columns to approved business attributes with a classification (PII, Confidential, Internal, Public), then push that classification to Snowflake as tags.

How it works

From scope to deployed tables, in one tool.

The order below is how most teams use Grain on a new subject area. You can enter at any step, for example by reading an existing Snowflake schema first.

  1. Scope the warehouse

    A context diagram shows which source systems feed which subject areas, and who consumes them. Mark anything out of scope before anyone draws a table.

  2. Design the model

    Each subject area has conceptual, logical and physical views. Start an entity from a template such as SCD Type 2 or Accumulating Snapshot Fact, and it arrives with the right keys and housekeeping columns. Or describe the business in plain language and let Design from requirements produce entities in third normal form.

  3. Compare with Snowflake

    Read Snowflake is read-only. It brings in databases, schemas, tables, columns, keys, defaults and view queries, then shows how the design differs from what's deployed.

  4. Deploy what you approved

    Generate DDL previews the script without running anything. Deploy runs it in dependency order, asks you to acknowledge each destructive statement, and stops at the first failure with a list of what ran.

  5. Govern and document

    Link columns to the glossary, apply DATA_CLASSIFICATION and BUSINESS_ATTRIBUTE tags, and export a data dictionary, dbt schema.yml, or a Cortex Analyst semantic model.

  6. Work on it together

    In the Snowflake app the whole team edits one model inside Snowflake, and every edit is attributed to the signed-in user; download it as plain YAML at any time and import it back. In Grain Desktop and the VS Code extension the model already is a folder of YAML, so it lives in Git and is reviewed in pull requests. Compare with a saved version or another copy, and take only the differences you choose.

One logical model, many layers Patent pending

Relational, lake and one big table, from one design.

Model the business once. Grain stores it as normalized tables, as Iceberg or VARIANT tables in the lake with child rows nested in their parents, and as wide one-big-tables at the grain you choose. Add loyalty_tier to customer and every layer picks it up.

Where a join would multiply rows, Grain makes you choose: aggregate, array or exclude. A one big table never silently duplicates or drops rows.

Customer 360 · Layer: Raw
Grain diagram in the Raw layer: customer, sales_order with order lines nested as an array, and payment, each marked LAKE
The layer lens redraws the diagram as a layer stores it. Here, order lines are nested inside sales_order.

Deploy you can read

A plan, a warning, and a block, before anything runs.

The preview counts CREATE, ALTER and unchanged tables and marks destructive statements. It warns when a change would shrink a column, and blocks an entity that isn't ready, such as an attribute with no data type.

Compare against the live tables, the schema you last read, or nothing at all. Export the script as .sql for your own pipeline if you prefer.

Generate DDL (preview)
Generate DDL preview: 4 CREATE, 1 ALTER, 1 destructive statement, a warning about a shorter VARCHAR and a blocked entity
Six entities: four CREATE, one ALTER, one blocked. Nothing has been run.

Design from requirements Patent pending

Third normal form you can check, not just trust.

Describe the business. Cortex lists the data items and what determines what, each with the sentence it came from. You confirm or correct them. Then Grain itself, not the language model, computes the entities and proves each one is in 3NF, that the join is lossless, and that every dependency is preserved.

The guarantee is stated honestly: it holds relative to the dependencies you confirmed.

Design from requirements
Design from requirements result: customer, order, order_product and product, each marked 3NF, with an explanation of why order_product is in third normal form
Four entities from five confirmed dependencies, each with the reason it is in 3NF.

Cortex as a modeling assistant

Suggestions arrive ticked, with a reason. You decide.

Ask Snowflake Cortex to complete an entity's design, review it, or draft its descriptions. It proposes attributes, types from your lexicons, NOT NULL and a grain. Untick what you don't want and apply the rest as one undoable step.

Anything that breaks your naming rules is listed, not quietly dropped. Cortex runs in your own Snowflake account, and it never sees rows from your tables.

Snowflake Cortex · Complete the design
Cortex suggestions for fact_order: change the grain to one row per order line, add tax_amount and channel_code, make customer_key NOT NULL
Four proposed changes to fact_order, each with its reason.

AI agents Patent pending

Your agents write the SQL. Grain checks it before it runs.

An agent can write a valid query that returns the wrong number: revenue counted twice through a join, a rate summed, every version of a customer counted. Grain gives agents the grain, the joins, the measures and what your terms mean, and grades each query PASS, REVIEW or FAIL, with what to change.

An MCP server for VS Code's agent mode, Claude Code and Cursor, and SQL functions for Cortex Agents inside Snowflake. Agents only read the model; they never change it.

Analyze · Check SQL against the model
Check SQL fails a query that counts customers and sums revenue in one join: each dim_customer row is repeated once per order, so the count of customers is too high
The customer count is inflated once per order. The check says so, and how to fix it.

Knowledge graph

Ask what a change will touch, before you make it.

The tables, glossary, concepts, rules, decisions and lineage you keep in Grain already form a graph. Open it at any item to see what links to it, what depends on it, or how two items are related.

Changing the definition of customer email? The graph shows the columns that carry the term, the tables they sit in, and the business rules written about them.

Knowledge graph · dim_customer
The knowledge graph around dim_customer: the Customer concept, fact_order which references it, a view that reads from it, and the glossary terms its columns carry
dim_customer with what it links to. Every link is listed on the right.

Who it's for

Built for the people who own the warehouse design.

Data architects

Standards that hold: design patterns with their required columns, a naming standard that turns business names into physical ones, lexicons for repeated types, and 24 configurable health rules. Coming from erwin or PowerDesigner? Bring your models with you.

Analytics engineers

A model that lives next to your dbt project, generates schema.yml, and deploys straight to Snowflake when you want it to. In VS Code beside your dbt project, or in the browser from Snowsight.

Governance leads

A glossary with Draft, In review and Approved states, classification on every linked column, review and check-out on entities, and a record of why each design decision was made.

Coming soon to Snowflake Marketplace

Install it like any other Snowflake app.

The Snowflake app will be a Snowflake Native App. It runs in a small container inside your own account, your people open it from Snowsight, and it is billed through your Snowflake invoice. Prefer the model on your own computers? Grain Desktop and the VS Code extension work on a folder instead.

1 · Get

Install from the listing

An account administrator gets Grain from Snowflake Marketplace. There is nothing to download and nothing to install on anyone's machine.

2 · Allow

Choose what it can reach

Grant the databases it may read and, if you want, deploy to. Grain always acts as the signed-in user, so it can never do more than that person's role allows.

3 · Open

Give your modelers the app role

They open Grain from Snowsight and work on one shared model. You can download it as YAML at any time, so the model is never locked in.

Early access

Bring one subject area. We'll model it with you in the first session.

We're onboarding a small number of Snowflake teams. Tell us about your warehouse and which way you'd like to run Grain, and we'll set you up with Grain Desktop or the VS Code extension on your team's computers, and a guided first model. Want the Snowflake app? Tell us, and we'll let you know as soon as it's listed.