Skip to content

added multiwarehouse handling #13

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

jesshitchcock
Copy link
Contributor

@jesshitchcock jesshitchcock commented Aug 1, 2025

I want to get the Saas demo compatible with different warehouses. To do this we need to apply different SQL logic depending on the warehouse type. In this PR I added logic to include Snowflake SQL in the date functions and added a new cross db date diff function.

To test this you can add a new profile to your .dbt/profiles.yml that points at a snowflake warehouse:

lightdash_demo_saas_snowflake:
  outputs:
    dev:
      type: snowflake
      account: 
      user:
      private_key: 
      role: 
      database: 
      warehouse: SNOWFLAKE_DATABASE_STAGING
      schema: dbt_demo
  target: dev

Fill in snowflake credentials from 1password.
Then run the following to:

  • temporarily update the dbt project name to lightdash_demo_saas_snowflake in dbt_profiles.yml
  • seed data: dbt seed
  • build models: dbt build -s models/demo/*
  • set lightdash project to SaaS demo: lightdash config set-project and select SaaS demo
  • create a preview: lightdash preview
  • check if you can query from tables in the preview project.

@oli-rmsy
Copy link
Contributor

Something in the back of my mind reminded me of this: https://docs.getdbt.com/reference/dbt-jinja-functions/cross-database-macros#date-and-time-functions

I think we can remove some logic here - and support all warehouses, by implementing the above dbt integrated macros.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants