KBAISE/ for lovable
Library
Docs

Connect your app to Databricks

about 15 minBuildingchecked 2h agoOfficial page
The short version

Connect your Lovable app to Databricks to use your existing data for dashboards and tools. This lets you run queries, manage warehouses, and build live reports without exporting data.

Anyone who wants to build apps or dashboards using data stored in Databricks needs this.

Do this, in order

  1. 1

    Ensure you have a Databricks workspace with a SQL warehouse, a service principal with an OAuth secret, its client ID and secret, your workspace URL, and permission to create connections in Lovable.

    These are the essential pieces of information and access rights needed before you can connect Lovable to Databricks.

  2. 2

    If you don't have one, create a service principal in your Databricks account console and assign it to your workspace with 'Workspace access' and 'Databricks SQL access' entitlements.

    The service principal acts as Lovable's identity in Databricks, allowing it to access your data and resources.

  3. 3

    Grant the service principal 'Can use' permission on the specific SQL warehouse your app will query.

    This allows the service principal to start the warehouse and run queries against it.

  4. 4

    Generate an OAuth secret for the service principal in Databricks settings, and immediately copy both the Client ID and Client Secret.

    These credentials are used by Lovable to authenticate with Databricks, and the secret is only shown once.

  5. 5

    Grant Unity Catalog privileges to the service principal (using its Application ID) for the catalogs, schemas, and tables your app needs to access, ensuring it has 'USE CATALOG', 'USE SCHEMA', and 'SELECT' permissions.

    This defines exactly what data the service principal, and thus your Lovable app, can read.

  6. 6

    Find your Databricks Workspace URL from your browser's address bar when signed in.

    Lovable needs this URL to know which Databricks instance to connect to.

  7. 7

    In Lovable, go to 'Connectors', select 'Databricks', and click 'Add connection'.

    This starts the process of setting up the connection in Lovable.

  8. 8

    Give your connection a descriptive name, enter your Databricks Workspace URL, Client ID, and Client Secret, then choose who in your Lovable workspace can use this connection.

    The name helps you identify the connection, and the credentials allow Lovable to authenticate. Setting access controls determines who can build apps using this Databricks connection.

  9. 9

    Click 'Connect' to finalize the setup.

    Lovable will verify the credentials and establish the connection.

Paste this into your project

I need to connect Lovable to Databricks. I have my Databricks Workspace URL, the Client ID, and Client Secret for a service principal, and I've configured its permissions in Unity Catalog. Please guide me through the steps to set up the connection in Lovable.

Words decoded

Databricks service principal
A special user account for applications, not people, that Lovable uses to securely connect to your Databricks data. It has its own permissions.
OAuth secret
A secure password-like key generated for the service principal, allowing Lovable to prove its identity to Databricks.
Unity Catalog
Databricks' system for managing access to data across your entire organization, letting you control who can see and use specific databases, tables, and files.
SQL warehouse
A computing resource in Databricks specifically designed to run your data queries quickly and efficiently.
Semantic layer
A consistent way to define business terms and metrics (like 'Monthly Recurring Revenue') across all your data tools, ensuring everyone uses the same calculations and definitions.

Where people get stuck

  • Do not grant the service principal more permissions than necessary (like 'MODIFY' or 'ALL PRIVILEGES') if you intend for the connection to be read-only, as this could allow unintended data changes.
  • Do not share a single Databricks connection with different teams if they need different levels of data access, as everyone using that connection will see the same data.
  • Do not forget to copy the Client ID and Client Secret immediately after generating them, as the secret cannot be retrieved later.
  • Do not expect Lovable to automatically enforce read-only access; you must configure this through Databricks Unity Catalog grants.
  • Do not assume Lovable will cache query results; you need to explicitly ask for caching if desired.
  • Do not rely on Lovable's connection access controls to limit who can view a published app; set website access controls separately during publishing.
  • Do not overlook Databricks IP access lists or Private Link configurations, as they can prevent Lovable from connecting if not properly configured to allow Lovable's gateway egress ranges.

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.