GrainER MODELER

Get started

From Marketplace listing to first model in one sitting.

An account administrator installs Grain from Snowflake Marketplace and runs a short setup script. Your modelers then open it from Snowsight. The full user manual is built into the app: ? Help in the sidebar, and every screen has a ? that opens the part about that screen.

A Snowflake accountIn a region where Snowpark Container Services is available.
An administrator, onceTo install the app, grant access and start it.
CortexOptional. Needed for the modeling assistant.
Enterprise EditionOptional. Needed only for Snowflake lineage.

For the administrator

Install and set up, once per account.

These steps use GRAIN_ER_MODELER as the app's name. Replace it with the name you install under, and ANALYTICS and MODELING_WH with your own database and warehouse.

Grain can never do more than the signed-in user's role allows. The grants below set an outer limit on top of that.

  1. Get Grain from Snowflake Marketplace

    In Snowsight, open Data Products > Marketplace, search for Grain ER Modeler, and choose Get. [Marketplace listing link]

  2. Let the app call Cortex

    Used for descriptions, design help and suggested subject areas. Skip this if you don't use Cortex.

    GRANT DATABASE ROLE SNOWFLAKE.CORTEX_USER
      TO APPLICATION GRAIN_ER_MODELER;
  3. Choose the databases it may work in

    Repeat for each database your modelers work in. Leave out OBJECT MANAGEMENT to keep Grain read-only.

    -- read schemas: Read Snowflake, Compare, Suggest subject areas
    GRANT CALLER USAGE ON DATABASE ANALYTICS TO APPLICATION GRAIN_ER_MODELER;
    GRANT CALLER OBJECT DISCOVERY ON DATABASE ANALYTICS TO APPLICATION GRAIN_ER_MODELER;
    -- deploy tables and governance tags
    GRANT CALLER OBJECT MANAGEMENT ON DATABASE ANALYTICS TO APPLICATION GRAIN_ER_MODELER;
    -- the warehouse those queries run on
    GRANT CALLER USAGE ON WAREHOUSE MODELING_WH TO APPLICATION GRAIN_ER_MODELER;
  4. Start the app

    This creates an extra-small warehouse, a one-node compute pool and the web service, all inside your account.

    CALL GRAIN_ER_MODELER.app_public.start_app();
  5. Choose who may use it

    GRANT APPLICATION ROLE GRAIN_ER_MODELER.app_user  TO ROLE DATA_MODELER;
    GRANT APPLICATION ROLE GRAIN_ER_MODELER.app_admin TO ROLE SYSADMIN;
  6. Set the warehouse in the app

    Open Grain from Data Products > Apps in Snowsight, choose Snowflake settings… in the sidebar, and enter the warehouse from step 3.

For modelers

Your first subject area.

The first time you open Grain it asks how you want to start: Read from Snowflake, Describe your business and get a third-normal-form design from Cortex, or Start from a template. Press ⌘K (Ctrl+K) at any time to search the model or run any command.

  1. Open Grain from Snowsight

    Go to Data Products > Apps and open Grain ER Modeler. You're signed in as yourself, with your own role. There is nothing else to sign in to.

  2. Create a subject area

    Click + next to Subject areas in the sidebar. A subject area is a named group of entities shown together on one diagram.

  3. Add entities from templates

    Add > New entity… offers a design pattern for each entity, such as SCD Type 2 or Transaction Fact. Drag from one attribute to another to relate entities, or run Detect relationships to match foreign keys to dimension keys by name.

  4. Or start from what's deployed

    Snowflake > Read Snowflake… brings in a schema, read-only, and can create entities for the tables it finds.

  5. Review and deploy

    Review and deploy opens the Changes drawer: the comparison with Snowflake, the generated DDL, and Deploy, which runs only after you've reviewed each statement.

Already have a model, or want one in Git?

Import it, download it, any time.

The model lives in a table inside the app, shared by everyone who uses it. It is the same set of YAML documents as an er-model folder, so it moves in and out freely.

  • Download model (YAML) in the sidebar gives you a zip of the er-model folder. Commit it to Git for review or history.
  • Import model folder… loads an er-model folder into the app, for example one you edited by hand or got from another account.
  • Edit the model through the app. To change the YAML by hand, download it, edit, and import it back.
er-model/
  workspace.yml            groups, naming standard, rules, settings
  entities/<entity>.yml    one per entity, shared across subject areas
  subject-areas/<name>.yml entities on a diagram, positions, notes
  glossary/<id>.yml        terms and business attributes
  concepts/<id>.yml        concepts and their relations
  context/<id>.yml         nodes on the context diagram
  lexicons/<id>.yml        named standard types
  objects/<id>.yml         schemas, sequences, stages, policies…
  decisions/<id>.yml       design decisions and their reasons
  comments/<entity>.yml    comment threads
  templates/<id>.yml       optional custom templates

Running costs

What it uses in your account, and how to pause it.

Snowflake bills these to your account as normal consumption, separately from the Grain subscription.

ResourceWhat it doesWhen it runs
Compute pool (one CPU_X64_XS node)Runs Grain's web service.Suspends after an hour with no requests and resumes on the next one.
The app's own XS warehouseStores the model and calls Cortex.Suspends after a minute idle.
Your warehouseReads schemas, deploys and sets tags, as the signed-in user.Only when someone runs one of those actions.
CortexThe modeling assistant.One request per entity you select.
-- stop everything until it's needed again, then resume
CALL GRAIN_ER_MODELER.app_public.stop_app();
CALL GRAIN_ER_MODELER.app_public.resume_app();

Stuck, or want a guided start?

Early access teams get a first session with us, modeling one of their own subject areas.