Connect your app to Databricks
Connect your Lovable app directly to Databricks to run queries and build live data dashboards. You can link either a shared bot account or your personal account without exposing secret keys in your app.
Anyone who wants to build internal tools, metrics explorers, or live dashboards using data stored in a Databricks data warehouse.
Do this, in order
- 1
Create a service principal in your Databricks account console and assign it to your target workspace.
A dedicated bot identity prevents your app's connection from breaking if a team member leaves the company.
- 2
Give the service principal 'Can use' permissions on your SQL warehouse in Databricks.
The connection needs permission to start the warehouse and execute queries.
- 3
Generate an OAuth secret for the service principal and copy the Client ID and Client Secret immediately.
Databricks only shows the secret once, and you need both credentials to connect Lovable.
- 4
Grant Unity Catalog data permissions (USE CATALOG, USE SCHEMA, and SELECT) to the service principal application ID.
Databricks blocks table reads unless all three levels of catalog, schema, and table access are explicitly allowed.
- 5
Open Connectors in Lovable, choose Databricks, and click Connect.
This opens the configuration screen to link your Databricks instance.
- 6
Enter your Workspace URL, Client ID, and Client Secret, configure sharing settings, and click Connect.
Lovable securely saves these credentials in its gateway and verifies access to your Databricks workspace.
Paste this into your project
Build a live KPI dashboard that queries our Databricks SQL warehouse and shows monthly recurring revenue, daily active users, and churn rate. Auto-refresh the charts every 5 minutes and include a date range filter.
Words decoded
- service principal
- An automated bot identity created for apps and scripts, rather than an individual human account.
- SQL warehouse
- The computing engine in Databricks that runs your data queries.
- Unity Catalog
- The Databricks permission system that controls exactly who can view or edit specific databases, schemas, and tables.
- OAuth
- A secure sign-in standard that lets apps talk to each other using temporary tokens instead of sharing passwords.
Where people get stuck
- The connector does not enforce read-only safety; it can run any SQL command the account is permitted to execute, including DELETE or UPDATE, unless restricted inside Unity Catalog.
- Granting SELECT on a table is not enough on its own; you must also grant USE CATALOG and USE SCHEMA or queries will fail.
- If you use User OAuth instead of a service principal, any queries run by others using that connection will carry your personal permissions and be logged under your name in audit logs.
- If your Databricks workspace restricts inbound IP addresses or disables public network access completely via Private Link, Lovable will not be able to connect.
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.