mirror of
https://github.com/supabase/supabase.git
synced 2026-09-08 19:08:44 +08:00
Adds ClickHouse as a replication destination type in Studio.
- New ClickHouse option in the destination type selector, gated behind
the
`etlEnableClickHousePrivateAlpha` organization feature flag (off by
default).
- ClickHouse settings form: URL, user, password (optional), database,
and
- Client-side URL validation requires HTTPS and rejects URLs targeting
internal addresses (loopback, RFC 1918, link-local, CGNAT, IPv6
loopback/link-local/ULA, and IPv4-mapped/NAT64 forms). Server-side
validation remains authoritative.
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit
## New Features
- Added **ClickHouse** as a replication destination option (private
alpha), including support in destination selection/panel, replication
diagram rendering, and destination icons.
- Introduced a ClickHouse destination form with fields for URL, user,
optional password (masked toggle), database, and engine selection.
- Added ClickHouse destination config handling for create/update flows,
with normalization and engine support.
## Tests
- Expanded unit tests to cover ClickHouse validation and destination
config building/normalization, including HTTPS-only and blocking
localhost/internal targets.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
---------
Co-authored-by: Joshen Lim <joshenlimek@gmail.com>
19 lines
554 B
TypeScript
19 lines
554 B
TypeScript
export type ReplicationDestinationType =
|
|
| 'BigQuery'
|
|
| 'Analytics Bucket'
|
|
| 'DuckLake'
|
|
| 'Snowflake'
|
|
| 'ClickHouse'
|
|
|
|
export const getReplicationDestinationType = (
|
|
config?: Record<string, unknown>
|
|
): ReplicationDestinationType | undefined => {
|
|
if (!config) return undefined
|
|
if ('big_query' in config) return 'BigQuery'
|
|
if ('iceberg' in config) return 'Analytics Bucket'
|
|
if ('ducklake' in config) return 'DuckLake'
|
|
if ('snowflake' in config) return 'Snowflake'
|
|
if ('clickhouse' in config) return 'ClickHouse'
|
|
return undefined
|
|
}
|