Usage & Workflows

Droughty is most valuable when it’s woven into your regular development workflow rather than run as a one-off. This page covers the conventions it expects, the workflow patterns that work well, and how it fits alongside dbt and Looker.


Prerequisites

Must be inside a git repository

Droughty uses Git to determine default output paths. Always run it from within your project’s git repository root.

Naming conventions

Droughty identifies keys by column name suffix. These conventions must be followed in your warehouse:

  • Primary keys end in _pk — e.g. customer_pk, order_pk

  • Foreign keys end in _fk — e.g. customer_fk, product_fk

Without these suffixes, droughty cannot distinguish keys from regular dimensions and won’t apply the correct tests, hiding logic, or DBML relationships.

Schema layer structure

Droughty is built around a layered warehouse structure. You need at least three separate schemas or datasets:

  • Staging — raw source data, lightly transformed (e.g. myproject_staging)

  • Integration — cleaned and integrated data (e.g. myproject_integration)

  • Analytics / Warehouse — the final analytics layer (e.g. myproject_analytics)

Reference these in test_schemas and dbml_schemas in your profile.yaml.

Column descriptions (optional but high-value)

If you use dbt with persist_docs enabled, column descriptions from your YAML files are written through to INFORMATION_SCHEMA. Droughty picks them up and includes them in generated LookML views and Cube cubes:

# dbt_project.yml
models:
  +persist_docs:
    relation: true
    columns: true

This means your descriptions only need to live in one place — your dbt YAML — and flow everywhere else automatically.


dbt Project Setup

For the layered schema structure to work with dbt, configure schema separation in dbt_project.yml:

models:
  +persist_docs:
    relation: true
    columns: true

  my_project:
    staging:
      materialized: view
      schema: staging
    integration:
      materialized: view
      schema: integration
    warehouse:
      materialized: table
    data_quality:
      materialized: table
      schema: data_quality


Looker Development Approach

Droughty generates a base layer of LookML views and explores. The right way to use this is to build Looker refinements or extends on top of the base layer — never edit the generated files directly.

Why? Because the whole value of automation is that the base layer can be regenerated any time the warehouse schema changes. If you’ve edited it by hand, that work gets overwritten. Refinements survive a regeneration.

Suggested file structure:

lookml/
├── views/
│   └── base.lkml           # Generated by droughty — do not edit
├── explores.lkml            # Generated by droughty — do not edit
├── measures.lkml            # Generated by droughty — do not edit
└── refinements/
    └── my_view.lkml         # Your customisations go here

When to run each command

Situation

Command(s) to run

After building or modifying dbt models

droughty dbt

Before committing changes that affect the warehouse schema

droughty lookml, droughty dbt

Before raising a PR (for documentation)

droughty dbml

When the analytics schema changes significantly

droughty lookml, droughty cube, droughty dbt

Onboarding a new data source

droughty stage -p <project> -d <dataset>

When warehouse fields have no descriptions

droughty docs

Before a data release or stakeholder demo

droughty qa

Questions or issues? Raise them on GitHub.