Skip to main content
The ClickHouse app connector lets your Lovable app run SQL queries against your ClickHouse database over the HTTP interface. It works with both self-hosted ClickHouse and ClickHouse Cloud. With ClickHouse connected, your app can:
  • Run SQL queries over the ClickHouse HTTP interface
  • Explore schema and table metadata via system tables
  • Paginate large result sets with LIMIT and OFFSET
  • Enforce per-query time limits to keep requests bounded

Common use cases and example apps

Example appExample promptDescription
Real-time analytics dashboardBuild a dashboard that shows event counts and trends from my ClickHouse events table, refreshed every minute.Turn high-volume event data into live charts. The app runs SQL against ClickHouse and renders metrics that stay current.
Log explorerBuild a tool to search and filter our application logs stored in ClickHouse by service, level, and time range.Self-serve search over large log tables. The app submits filtered queries and returns results without console access.
Schema explorerBuild a tool that lists databases and tables and shows column types and row counts.Browse what’s in the database. The app reads system tables to describe schemas.
Usage metering viewShow per-customer usage aggregated from our ClickHouse usage table, with date filters.Surface aggregates from curated tables. The app queries summary tables your pipelines maintain.
Exact behavior depends on your tables, the permissions of the ClickHouse user you connect with, and what you ask Lovable to build.

How ClickHouse connections work

  • HTTP interface: The connector talks to the ClickHouse HTTP interface over HTTPS. You provide the full HTTPS URL of the interface, including the port (for example https://abc123.eu-central-1.aws.clickhouse.cloud:8443).
  • Authentication: ClickHouse uses HTTP basic auth. Provide the username and password of the database user you want to connect with. Credentials are stored securely in Lovable’s gateway and are never exposed to the browser or your app’s frontend code.
  • Gateway: Queries are proxied through Lovable’s connector gateway, which injects the host and credentials so your app never sends them. See Gateway-based connectors for token handling and per-project request limits.
  • Data access: What you can read or run depends entirely on the permissions of the ClickHouse user you connect with.
Use a read-only ClickHouse user. Create a dedicated user with read-only access to only the databases and tables your app needs. The user’s permissions determine what every app using the connection can query, so scoping it down limits what a query can reach.

How to connect ClickHouse

Who can connect ClickHouse depends on your plan and workspace settings. See Who can create connections for details.

Prerequisites

Before connecting in Lovable, make sure you have:
  • A ClickHouse database (self-hosted or ClickHouse Cloud) with the HTTP interface reachable over HTTPS
  • The HTTPS URL of your HTTP interface, including the port
  • A ClickHouse user (a read-only user is recommended) with access to the data your app needs
  • Permission to create connections in your Lovable workspace

Set up your ClickHouse connection

1

Navigate to ClickHouse connector

Open ConnectorsApp connectors and select ClickHouse.
2

Add a new connection

Click Add connection.
3

Name the connection

In Display name, name the connection (for example, ClickHouse Production or ClickHouse read-only).
4

Enter your connection details

  • HTTP Interface URL: the full HTTPS URL of your ClickHouse HTTP interface, including the port (e.g. https://abc123.eu-central-1.aws.clickhouse.cloud:8443).
  • Username: the ClickHouse user for HTTP basic authentication.
  • Password: that user’s password.
To connect without authentication, leave both Username and Password empty. No auth header is sent and ClickHouse uses its default user. See the HTTP interface docs for details.
5

Choose who can use this connection

Under Who can use this connection, decide who in your workspace can use the connection:
  • Only you (default): only the person creating the connection can use it and its associated data.
  • Invite specific people: only you and explicitly added workspace members can use the connection and its associated data.
  • Invite entire workspace: click Invite entire workspace to make the connection available to everyone in your Lovable workspace.
See Who can manage connections for more information.
6

Connect

Click Connect. Lovable verifies the connection through the gateway with a SELECT 1 query.
When connected, you can link the connection to projects and start building apps that query your ClickHouse data.

Limitations

  • No per-user data scoping. Everyone using a connection queries with the same ClickHouse user. Use a read-only user scoped to the right databases, and restrict who can use the connection.
  • Queries are synchronous. There is no polling or server-side cursor. Paginate with SQL LIMIT / OFFSET, and raise the per-query time limit for long queries.
  • No default database. Qualify table names with the database (e.g. mydb.users).
  • Gateway limits apply as described in Gateway-based connectors.
Editors and above can remove specific projects from a connection without deleting the connection entirely. The connection will remain available for other projects. To unlink projects:
1

Open Connectors

Open Connectors, then go to App connectors, and select .
2

Open the connection

Open the connection you want to manage.
3

Select projects

Under Linked projects, check the projects you want to unlink.
4

Confirm

Click Unlink projects and confirm.
When unlinked, those projects will no longer have access to through this connection. If a project needs again, you can link it to any available connection.

How to delete a connection

Workspace admins and owners can delete connections. Other members can delete a connection if they created it, or if they have been explicitly granted access to it.
Deleting a connection is permanent and cannot be undone. It will remove the credentials from all linked projects, and any apps using this connection will stop working until a new connection is added.
Before deleting, review the Linked projects section to see which projects are currently using the connection. To delete a connection:
1

Open Connectors

Open Connectors, then go to App connectors, and select .
2

Open the connection

Open the connection you want to remove.
3

Review linked projects

Review the Linked projects section.
4

Delete

Under Delete this connection, click Delete and confirm.