KBAISE/ for lovable
Library
Docs

Connect your app to Snowflake

about 20 minBuildingchecked 3d agoOfficial page
The short version

Connect your company's Snowflake account to Lovable using secure credentials instead of hardcoded passwords. This lets your app query your data warehouse, generate dashboards, and run analytics workflows.

Anyone who wants to build dashboards, internal tools, or AI workflows using data already stored in Snowflake.

Do this, in order

  1. 1

    Copy your Snowflake Account URL from the account selector in Snowsight, omitting any trailing slashes or extra paths.

    Lovable requires the exact account URL format to route queries to your Snowflake instance.

  2. 2

    In Snowflake, run the provided SQL scripts using an admin role to create a dedicated role (such as LOVABLE_ROLE), grant it access to your warehouse and data, and assign it to an authorizing user.

    Admin roles are blocked from direct connections for safety, so you must create a role restricted only to the tables your app needs.

  3. 3

    Run the SQL command to create a custom OAuth security integration with Lovable's redirect URI.

    This registers Lovable as an authorized OAuth client in your Snowflake account.

  4. 4

    Run SYSTEM$SHOW_OAUTH_CLIENT_SECRETS in Snowflake and copy the client ID and client secret.

    Lovable needs these client keys to securely authenticate and refresh access tokens.

  5. 5

    In Lovable, navigate to Connectors > Snowflake > Connect, enter the Account URL, Client ID, Client Secret, and uppercase Role name, then click Connect to sign in and authorize.

    This completes the authorization handshake and saves the connection to your workspace.

  6. 6

    Open your Lovable project chat and ask Lovable to link your Snowflake connection and run a query against a specific table or view.

    Testing a query immediately verifies that your warehouse and data permissions were configured properly.

Paste this into your project

Link this project to our Snowflake connection. Build an analytics dashboard that queries our connected Snowflake warehouse to display a summary table of the ten most recent records and a chart tracking record counts over time.

Words decoded

OAuth
A secure sign-in method that lets Lovable access Snowflake using temporary tokens without ever saving your actual account password.
Warehouse
In Snowflake, the virtual computing power that runs queries and processes data.
Role
A permission bundle in Snowflake that defines exactly which tables, views, and compute resources a user or app can access.
Security Integration
A Snowflake setting that defines how external services like Lovable are allowed to connect via OAuth.

Where people get stuck

  • Do not try to connect using ACCOUNTADMIN or SECURITYADMIN roles; Snowflake and Lovable will block the connection.
  • Do not use a TYPE = SERVICE user to authorize the connection because the authorization code flow requires an interactive browser sign-in.
  • Always type your role name in uppercase in the Lovable connection form to avoid case-sensitivity errors.
  • A successful authorization screen does not guarantee queries will work; if queries fail, confirm that LOVABLE_ROLE has USAGE permissions on both your warehouse and database schema.
  • Snowflake OAuth refresh tokens expire after 90 days, meaning an admin will need to reconnect the integration quarterly.

The short version, steps, decoder and prompt on this page are written automatically from Lovable's own documentation and can lag or misread it. The official page is always the authority.