Connect your app to Databricks
You can connect your Lovable app to Databricks to use your existing data for dashboards and tools. This lets your app run queries and manage resources in Databricks without needing to export data manually.
Anyone who wants to build apps or dashboards that use data stored in Databricks.
Do this, in order
- 1
Ask your Databricks admin to create a service principal, assign it to your workspace with 'Workspace access' and 'Databricks SQL access', grant it 'Can use' on a SQL warehouse, generate an OAuth secret (Client ID and Client secret), and grant it 'USE CATALOG', 'USE SCHEMA', and 'SELECT' privileges on the data it needs to access.
This sets up a secure, dedicated identity in Databricks that your Lovable app will use to access data, ensuring it only sees what you allow.
- 2
Get the Databricks Workspace URL from your browser's address bar when logged into Databricks.
This is the address Lovable needs to find your Databricks workspace.
- 3
In Lovable, go to 'Connectors', select 'Databricks', and click 'Add connection'.
This starts the process of linking your Lovable project to your Databricks setup.
- 4
Give your connection a clear 'Display name' (e.g., 'Databricks Engineering') and enter the Workspace URL, Client ID, and Client secret you gathered.
The name helps you identify the connection's purpose, and the credentials allow Lovable to securely authenticate with Databricks.
- 5
Decide who in your Lovable workspace can use this connection by sharing it with specific members or the entire workspace.
Since the service principal's permissions determine data access, you control who can query that data through this connection in Lovable.
- 6
Click 'Connect' to finalize the setup.
Lovable will verify your credentials and establish the connection, making your Databricks data available for app building.
Paste this into your project
I need to connect my Lovable app to Databricks. I have a Databricks service principal with its Client ID and Client secret, and I know my Databricks Workspace URL. Please guide me through the steps to set up the connection in Lovable.
Words decoded
- Service Principal
- A special user account for applications, not people, that has its own permissions to access resources in Databricks.
- OAuth secret
- A secure password-like code used by applications to prove their identity when connecting to other services, like Databricks.
- SQL Warehouse
- A computing resource in Databricks specifically designed to run data queries efficiently.
- Unity Catalog
- Databricks' system for managing data, security, and governance across all your data assets.
- Semantic Layer
- A consistent way to define business terms and metrics (like 'Monthly Recurring Revenue') so everyone uses the same calculations and data sources.
Where people get stuck
- Forgetting to copy the Client ID and Client secret immediately after generating them, as the secret is only shown once.
- Granting too many permissions to the service principal, as everyone with access to the Lovable connection will inherit those permissions.
- Not configuring Databricks IP access lists to allow Lovable's gateway egress ranges, preventing the connection from working.
- Assuming Lovable enforces read-only access; you must use Unity Catalog privileges to restrict the service principal's access.
- Not setting a `STATEMENT_TIMEOUT` in Databricks, which could lead to very long-running and expensive queries.
- Misunderstanding that connection access in Lovable controls who can build with the connection, not who can visit a published app; audience control for published apps is separate.
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.