KBAISE/ for lovable
Library
Docs

Connect your app to ClickHouse

about 5 minBuildingchecked 3d agoOfficial page
The short version

Connect your Lovable app to ClickHouse to run SQL queries and build fast analytics dashboards. Lovable sends queries through a secure gateway so your database password never reaches the browser.

Anyone who wants to display live charts, logs, or usage metrics from a ClickHouse database inside their Lovable app.

Do this, in order

  1. 1

    Go to Connectors in Lovable and select ClickHouse.

    This opens the configuration screen for the ClickHouse integration.

  2. 2

    Click Connect and give your connection a clear display name.

    A recognizable name helps you identify the connection later across your projects.

  3. 3

    Enter the full HTTPS URL of your ClickHouse HTTP interface including the port number.

    Lovable connects over HTTPS, and omitting the port will cause the connection to fail.

  4. 4

    Enter your ClickHouse username and password, or leave them empty to use the default user.

    These credentials authenticate your queries through the gateway without exposing them in your frontend code.

  5. 5

    Choose whether to keep the connection private or share it with your workspace, then click Connect.

    Lovable automatically runs a test query to verify the connection works before saving.

  6. 6

    In your project prompts, always specify the full database and table name like my_database.events.

    The connector does not set a default database, so queries fail if the database name is missing.

Paste this into your project

Connect to my ClickHouse database and build an analytics dashboard. Run queries against my_database.events to calculate daily active events over the past 30 days and show the results in a line chart. Use LIMIT and OFFSET to display the latest 50 raw event rows in a paginated table below the chart.

Words decoded

HTTP interface
A web-friendly doorway that allows apps to send database queries using standard web addresses.
Connector gateway
A secure Lovable proxy server that handles your database credentials so they are never exposed to users' web browsers.
Read-only user
A database account configured to only look at data without permission to change or delete anything.

Where people get stuck

  • Leaving out the port number in the HTTP URL (for example, missing :8443).
  • Writing SQL queries without prefixing the table with its database name (for example, writing events instead of analytics.events).
  • Connecting with an unrestricted admin account instead of a scoped, read-only user.

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.