بنقرة واحدة
database-clickhouse-weaviate
ClickHouse queries, Goose migrations, chdb test schema, or telemetry storage paths.
التثبيت باستخدام Codex أو Claude انسخ هذا Prompt والصقه في Codex أو Claude أو مساعد آخر ليراجع صفحة Skill ويثبّتها لك.
القائمة
ClickHouse queries, Goose migrations, chdb test schema, or telemetry storage paths.
التثبيت باستخدام Codex أو Claude انسخ هذا Prompt والصقه في Codex أو Claude أو مساعد آخر ليراجع صفحة Skill ويثبّتها لك.
استنادا إلى تصنيف SOC المهني
Adding or changing routes in `apps/api`. One source of truth (`defineApiEndpoint` + a Zod schema) becomes an HTTP endpoint, an OpenAPI operation, an MCP tool, and a TS SDK method — descriptions and contracts must be written with all four readers in mind.
Layering and boundaries, web vs public API, app layout (clients, routes, logging), ports/adapters, runtime-portable domain/shared/utils code, multi-tenancy, DDD layout, or anti-patterns.
Preparing a production release, pushing a vX.Y.Z release tag, running scripts/release.sh, or updating CHANGELOG.md with the changes that are about to be deployed to production.
Enables or disables Latitude production maintenance mode by redirecting all publicly exposed production services to the Better Stack status page. Use when asked to start, stop, toggle, verify, or prepare a maintenance window.
Adding or reading env vars, updating .env.example, or validating config at startup with parseEnv / parseEnvOptional.
Biome formatting, import style, strict TypeScript, naming (including React file names), or generated files.
| name | database-clickhouse-weaviate |
| description | ClickHouse queries, Goose migrations, chdb test schema, or telemetry storage paths. |
When to use: ClickHouse queries, Goose migrations, chdb test schema, or telemetry storage paths.
ClickHouse adapter stack remains SQL-oriented in packages/platform/db-clickhouse.
All ClickHouse queries must use parameterized bindings ({name:Type} syntax with query_params) — never interpolate user-supplied values directly into SQL strings.
Install goose (if not already installed):
brew install goose
Migration files live in packages/platform/db-clickhouse/clickhouse/migrations/:
unclustered/ — single-node deployments (local dev, default)clustered/ — distributed deployments (LAT_CLICKHOUSE_CLUSTER_ENABLED=true)Goose tracks applied migrations automatically in the goose_db_version table. The repo also keeps packages/platform/db-clickhouse/clickhouse/.migration-lock, regenerated by ch:create, solely to force git conflicts when developers create migrations in parallel.
Same rule as Postgres: do not run ch:* or ch:schema:dump unless the user explicitly asked in this conversation.
Commands (run from repo root):
# Apply all pending migrations
pnpm --filter @platform/db-clickhouse ch:up
# Roll back last migration
pnpm --filter @platform/db-clickhouse ch:down
# Show migration status
pnpm --filter @platform/db-clickhouse ch:status
# Create a new migration (creates the next sequential file in both unclustered/ and clustered/)
pnpm --filter @platform/db-clickhouse ch:create <migration_name>
# Roll back ALL migrations (equivalent to drop)
pnpm --filter @platform/db-clickhouse ch:drop
# Reset ClickHouse volume and re-migrate (nuclear option)
pnpm --filter @platform/db-clickhouse ch:reset
# Seed sample span data
pnpm --filter @platform/db-clickhouse ch:seed
ch:create <name> — creates the next sequential migration (for example 00016_name.sql) in both unclustered/ and clustered/, and updates clickhouse/.migration-lockclickhouse/.migration-lock.sql file with -- +goose Up and -- +goose Down sections-- +goose NO TRANSACTION (ClickHouse does not support transactions)unclustered/ and clustered/ instead.ALTER TABLE or additive projection migrations with sensible defaults unless the change truly requires a table rebuild.unclustered/: use standard table engines (e.g. ReplacingMergeTree)clustered/: add ON CLUSTER default and use Replicated* enginesIn clustered ClickHouse, replicas can temporarily lag DDL metadata propagation. A migration can fail with:
code: 517Code: 517doesn't catchup with latest ALTER query updatesUse these authoring rules to reduce failures:
IF EXISTS / IF NOT EXISTS) so retries are safe.ALTER statements in one migration.ALTER TABLE ... with multiple actions over multiple dependent ALTER statements.ch:up against the same cluster).Execution safety:
packages/platform/db-clickhouse/clickhouse/scripts/up.sh retries transient replica lag errors from goose ... up.alter_sync, distributed_ddl_task_timeout, and replication_wait_for_inactive_replica_timeout to improve DDL convergence.LAT_CLICKHOUSE_MIGRATION_MAX_RETRIES (default 20)LAT_CLICKHOUSE_MIGRATION_RETRY_DELAY_SECONDS (default 5)LAT_CLICKHOUSE_MIGRATION_MAX_RETRY_DELAY_SECONDS (default 30)LAT_CLICKHOUSE_MIGRATION_ALTER_SYNC (default 2)LAT_CLICKHOUSE_MIGRATION_DISTRIBUTED_DDL_TASK_TIMEOUT_SECONDS (default 300)LAT_CLICKHOUSE_MIGRATION_REPLICA_WAIT_TIMEOUT_SECONDS (default 300)