xiaohongshu
xiaohongshu
clickhouse-cloud-connection
Test and validate ClickHouse Cloud connection using clickhouse-connect for gapless-crypto-clickhouse. Use when validating connectivity, troubleshooting connection issues, or verifying environment configuration. Includes version check and query validation.
Full skill instructions
Validate ClickHouse Cloud connectivity and troubleshoot connection issues for gapless-crypto-clickhouse service.
Test connection to ClickHouse Cloud service using clickhouse-connect library with credentials from Doppler. This skill guides the workflow of:
secure=True for Cloud)Use this skill when:
Triggers: User mentions "test connection", "connection failed", "ClickHouse unreachable", "validate credentials"
Required Environment Variables (loaded from Doppler aws-credentials/prd):
CLICKHOUSE_HOST: Service hostname (e.g., ebmf8f35lu.us-west-2.aws.clickhouse.cloud)CLICKHOUSE_PORT: HTTPS port (8443)CLICKHOUSE_USER: Database user (default)CLICKHOUSE_PASSWORD: Database passwordRequired Library:
# Install clickhouse-connect (if not already installed)
uv pip install clickhouse-connect
# Run Python with Doppler environment
doppler run --project aws-credentials --config prd -- python test_connection.py
Environment Loading: Doppler injects all CLICKHOUSE_* secrets as environment variables
import os
import clickhouse_connect
# Load from environment (set by Doppler)
client = clickhouse_connect.get_client(
host=os.getenv("CLICKHOUSE_HOST"),
port=int(os.getenv("CLICKHOUSE_PORT", "8443")),
username=os.getenv("CLICKHOUSE_USER", "default"),
password=os.getenv("CLICKHOUSE_PASSWORD"),
secure=True # CRITICAL: Required for ClickHouse Cloud
)
Key Configuration:
secure=True: Enforces TLS/SSL for ClickHouse Cloud (HTTPS endpoint)8443: HTTPS protocol (not 8123 for HTTP)# Query ClickHouse version and current user
result = client.query("SELECT version() as version, currentUser() as user")
version = result.result_rows[0][0]
current_user = result.result_rows[0][1]
print(f"✅ Connection successful!")
print(f" ClickHouse version: {version}")
print(f" User: {current_user}")
Expected Output:
✅ Connection successful!
ClickHouse version: 25.8.1.8702
User: default
# Test query: Count tables in system database
result = client.query("SELECT count() FROM system.tables")
table_count = result.result_rows[0][0]
print(f" Tables visible: {table_count}")
Success Criteria: Query executes without errors, returns numeric count
# Test query: Fetch first row from gapless_crypto.klines (if exists)
try:
result = client.query("SELECT * FROM gapless_crypto.klines LIMIT 1")
print(f" Data accessible: ✅ (gapless_crypto.klines)")
except Exception as e:
print(f" Data accessible: ⚠️ (table not yet created)")
See: references/connection-test.py for complete executable example
Quick Test (one-liner):
doppler run --project aws-credentials --config prd -- python -c "
import os, clickhouse_connect
client = clickhouse_connect.get_client(
host=os.getenv('CLICKHOUSE_HOST'),
port=int(os.getenv('CLICKHOUSE_PORT')),
username=os.getenv('CLICKHOUSE_USER'),
password=os.getenv('CLICKHOUSE_PASSWORD'),
secure=True
)
print('✅ Connected:', client.query('SELECT version()').result_rows[0][0])
"
default userIssue: "Connection refused" or "Timeout"
CLICKHOUSE_HOST is correct (should be *.aws.clickhouse.cloud)8443 (HTTPS), not 8123 (HTTP)running (may be paused due to idle scaling)Issue: "Authentication failed"
CLICKHOUSE_PASSWORD in Doppler matches console passwordIssue: "SSL/TLS error"
secure=True parameter is set in get_client()secure=TrueIssue: "Query slow (>10 seconds)"
Issue: "Table not found (gapless_crypto.klines)"
| Parameter | Value | Description |
|---|---|---|
host | ebmf8f35lu.us-west-2.aws.clickhouse.cloud | Service hostname (us-west-2) |
port | 8443 | HTTPS port (not 8123) |
username | default | Default database user |
password | (from Doppler) | Database password |
secure | True | Required for ClickHouse Cloud (TLS/SSL) |
a3163f31-21f4-4e22-844e-ef3fbc26ace22404d339-6921-4f1c-bf80-b07d5e23b91a)references/connection-test.pyAfter successful connection validation:
xiaohongshu
technical spec
product ux expert
database patterns
Conduct multi-agent task orchestration and workflow coordination.
Initialize project with Conductor artifacts (product definition,
Expert in web animations, transitions, and motion design using Framer Motion and CSS
Creates Mermaid and ASCII diagrams for flowcharts, architecture, ERDs, state machines, mindmaps, and more. Use when user mentions diagram, flowchart, mermaid, ASCII diagram, text diagram, terminal diagram, visualize, C4, mindmap, architecture diagram, sequence diagram, ERD, or needs visual docume...
PostgreSQL bindings for H3 hexagonal grid system. Use when working with H3 cells in Postgres, including spatial indexing, geometry/geography integration, and raster analysis.
Context-Driven Development skill for projects using Conductor. Use this skill when you detect a `conductor/` directory in the project, when working on tasks defined in a `plan.md` file, or when the user asks about tracks, specs, or plans. Automatically applies TDD workflow, tracks task completion...
Display project status, active tracks, and next actions
Official Stakpak application containerization standard operating procedure, a step-by-step guidline to properly dockerize applications. This is a rule book curated by the Stakpak Team.
Generate, edit, and beat-sync AI video with leading models in one workspace.
The world's fastest calendar for remote work
Transform Your Design with AI Designer by ImgCreator.ai
Revolutionizing Video Production with AI-Powered Creativity
Extend an image past the frame and let AI fill the new aspect ratio.
Discover your celebrity doppelgänger with StarByFace!
ChainClarity explains 700+ crypto whitepapers in plain English, with layered summaries, comparisons, research tools, alerts, and a $4.99 Pro plan.
Opus.ai: Revolutionize Your Web Experience