Index of every page on this site: llms.txt
All skills
jeremylongshore avatar

/clickhouse-multi-env-setup

@0d57af8
Run it yourself

Configure ClickHouse across dev, staging, and production with environment-specific settings, secrets management, and infrastructure-as-code patterns. Use when setting up per-environment ClickHouse instances, managing connection configs, wiring secrets per environment, or deploying to multiple environments. Trigger with "clickhouse environments", "clickhouse dev staging prod", "clickhouse multi-env", "clickhouse environment config", "clickhouse staging setup".

Use this Skill: https://skilld.dev/gh/jeremylongshore/tons-of-skills-marketplace/clickhouse-multi-env-setup

Nothing lands on disk. Nothing to clean up.

Fork this Skill

Edit a local copy. It keeps the author and licence.

referencesexamples.md

≈665 tokens on demand. Your agent reads this file only when SKILL.md points to it.

ClickHouse Multi-Environment Setup — Examples

Worked, end-to-end examples that combine the building blocks from implementation.md into runnable flows.

Example 1: Environment strategy at a glance

The three-tier layout this skill provisions:

Environment Instance Purpose Data
Development Docker local Fast iteration Synthetic seed data
Staging ClickHouse Cloud (Dev tier) Pre-prod validation Sampled prod copy
Production ClickHouse Cloud (Prod tier) Live traffic Real data

Example 2: Full CI/CD deploy pipeline (Step 7)

Staging deploys automatically; production is gated behind needs: deploy-staging plus a GitHub environment: production that requires manual approval. Each job injects only its own environment's secrets, and schema:apply runs before the deploy so the database is migrated in lockstep with the code.

# .github/workflows/deploy.yml
jobs:
  deploy-staging:
    runs-on: ubuntu-latest
    environment: staging
    env:
      NODE_ENV: staging
      CLICKHOUSE_HOST: ${{ secrets.CLICKHOUSE_HOST_STAGING }}
      CLICKHOUSE_USER: ${{ secrets.CLICKHOUSE_USER_STAGING }}
      CLICKHOUSE_PASSWORD: ${{ secrets.CLICKHOUSE_PASSWORD_STAGING }}
    steps:
      - uses: actions/checkout@v4
      - uses: actions/setup-node@v4
        with: { node-version: "20" }
      - run: npm ci
      - run: npm run schema:apply   # Apply schema changes
      - run: npm run test:integration  # Run against staging CH
      - run: npm run deploy:staging

  deploy-production:
    needs: deploy-staging
    runs-on: ubuntu-latest
    environment: production   # Requires manual approval
    env:
      NODE_ENV: production
      CLICKHOUSE_HOST: ${{ secrets.CLICKHOUSE_HOST_PROD }}
      CLICKHOUSE_USER: ${{ secrets.CLICKHOUSE_USER_PROD }}
      CLICKHOUSE_PASSWORD: ${{ secrets.CLICKHOUSE_PASSWORD_PROD }}
    steps:
      - uses: actions/checkout@v4
      - uses: actions/setup-node@v4
        with: { node-version: "20" }
      - run: npm ci
      - run: npm run schema:apply
      - run: npm run deploy:production

Example 3: Querying from application code

Once the client factory is in place, application code never touches environment logic — it just asks for the client and the config module resolves the right instance from NODE_ENV.

import { getClient } from './clickhouse/client';

// Resolves to app_dev / app_staging / app_prod automatically
const rows = await getClient().query({
  query: 'SELECT count() AS c FROM events WHERE date = today()',
  format: 'JSONEachRow',
});
console.log(await rows.json());

Source: SKILL.md on GitHub

skilld matched fixed text patterns in SKILL.md and file names. Patterns miss obfuscated code.

skilld run checks every file with the same patterns. It asks for approval before it loads a Skill with a behavior marked Needs approval.

No alerts2mo3 checks · Risk SAFE
  • Gen Agent Trust Hub2mo

    The skill provides a multi-environment configuration setup for ClickHouse but includes a hardcoded default password for development and a schema migration script that executes SQL files without validation.

  • Socket2mo

    No alerts

  • Snyk2mo

    Risk: LOW · No issues

Signed by skilld at 0d57af8. This ties the file your Agent reads to that commit on GitHub. It does not review the instructions.

Last checked against GitHub yesterday.

Activeupdated 4 months ago
What it can do
Reads files Edits files Runs commands
version
1.7.0
author
Jeremy Longshore <jeremy@intentsolutions.io>
tags
[
  "saas",
  "database",
  "analytics",
  "clickhouse",
  "olap"
]
All 6 allowed tools
ReadWriteEditBash(aws:*)Bash(gcloud:*)Bash(vault:*)
Other metadata
compatibility
Designed for Claude Code

README badge

README badge for jeremylongshore/tons-of-skills-marketplace/clickhouse-multi-env-setup