Skip to content

Add secure field to ClickHouse connection config#5751

Open
meteoFurletov wants to merge 1 commit intoSQLMesh:mainfrom
meteoFurletov:clickhouse-secure-field
Open

Add secure field to ClickHouse connection config#5751
meteoFurletov wants to merge 1 commit intoSQLMesh:mainfrom
meteoFurletov:clickhouse-secure-field

Conversation

@meteoFurletov
Copy link
Copy Markdown

Summary

  • Add secure: bool = False field to ClickhouseConnectionConfig for explicitly enabling HTTPS/TLS
  • Add "secure" to _connection_kwargs_keys so it gets passed through to clickhouse_connect.dbapi.connect()

Problem

There is currently no way to explicitly enable HTTPS/TLS on a ClickHouse connection via SQLMesh config. Users must rely on port-based auto-detection (port 8443), which doesn't always work — especially when SQLMesh provides its own pool manager via connection_pool_options.

The clickhouse-connect library's dbapi.connect() already accepts a secure parameter (bool) that controls HTTPS/TLS, but ClickhouseConnectionConfig doesn't expose it.

Fix

Expose the secure parameter that clickhouse-connect already supports:

  1. Added secure: bool = False field after tls_mode in the HTTPS/TLS settings section
  2. Added "secure" to the _connection_kwargs_keys set so it's passed to connect()

Backwards compatibility

Fully backwards-compatible — defaults to False, matching the current behavior.

Test plan

  • Verified the field is added and passed through via _connection_kwargs_keys
  • Users can set secure: true in their config.yaml to enable HTTPS/TLS

🤖 Generated with Claude Code

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant