---
title: Connect Lovable to Databricks
description: Learn how to connect a Lovable-hosted app to your Databricks workspace to query data using OAuth machine-to-machine authentication.
canonical_url: https://docs.databricks.com/gcp/en/integrations/lovable
---

# Connect Lovable to Databricks

[Lovable](https://lovable.dev/) is a no-code application platform that lets teams build and deploy apps without writing code. With the Databricks integration, Lovable-hosted apps can query data stored in your Databricks lakehouse using the Databricks REST API and OAuth machine-to-machine (M2M) authentication.

For example, you can build forecasting dashboards or reporting apps backed by lakehouse data.

## <a id="prerequisites" />Prerequisites

Before you configure the integration, you need the following:

* A Databricks workspace. See [Create a workspace](https://docs.databricks.com/gcp/en/admin/workspace/index.md).
* A Databricks [service principal](https://docs.databricks.com/gcp/en/admin/users-groups/manage-service-principals.md) with access to the workspace.
* An [OAuth secret](https://docs.databricks.com/gcp/en/dev-tools/auth/oauth-m2m.md#create-secret) for the service principal. Save the **client ID** and **secret**. The secret is shown only once.
* An existing [SQL warehouse](https://docs.databricks.com/gcp/en/compute/sql-warehouse/create.md) in your workspace. The service principal must have access to the SQL warehouse.
* A [Lovable](https://lovable.dev/) account.

## <a id="connection-details" />Step 1: Get the Databricks connection details

To connect from Lovable, you need the following values from your Databricks workspace:

* **Workspace URL**: The URL of your Databricks workspace, such as `https://dbc-1234567890123456.cloud.databricks.com`. See [Get identifiers for workspace objects](https://docs.databricks.com/gcp/en/workspace/workspace-details.md).
* **Client ID**: The application ID of your service principal. This is the same value as the client ID displayed when you generated the OAuth secret.
* **Client secret**: The OAuth secret you generated for the service principal.

## <a id="configure-lovable" />Step 2: Configure the connection in Lovable

To connect your Lovable app to Databricks, see [Connect your app to Databricks](https://docs.lovable.dev/integrations/databricks) in the Lovable documentation.

Lovable stores these credentials as encrypted environment variables and passes them to your app at runtime.

## <a id="query-data" />Step 3: Query Databricks data

After you configure the connection, create a Lovable app that queries Databricks data. When you describe the app you want to build, the Lovable agent automatically discovers available SQL warehouses and uses the Databricks REST API to run SQL queries.

## <a id="additional-resources" />Additional resources

* [Lovable integrations overview](https://docs.lovable.dev/integrations/introduction)
* [Service principals](https://docs.databricks.com/gcp/en/admin/users-groups/service-principals.md)
* [Authorize Databricks service principal access to Databricks with OAuth](https://docs.databricks.com/gcp/en/dev-tools/auth/oauth-m2m.md)
* [Get connection details for a Databricks compute resource](https://docs.databricks.com/gcp/en/integrations/compute-details.md)
