- Run SQL queries over the ClickHouse HTTP interface
- Explore schema and table metadata via system tables
- Paginate large result sets with
LIMITandOFFSET - Enforce per-query time limits to keep requests bounded
Common use cases and example apps
| Example app | Example prompt | Description |
|---|---|---|
| Real-time analytics dashboard | Build 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 explorer | Build 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 explorer | Build 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 view | Show 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. |
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.
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
Name the connection
In Display name, name the connection (for example,
ClickHouse Production or ClickHouse read-only).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.
default user. See the HTTP interface docs for details.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.
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.
How to unlink projects from a connection
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:
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.