一键导入
database-clickhouse-weaviate
ClickHouse queries, Goose migrations, chdb test schema, Weaviate collections/migrations, or telemetry storage paths.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
ClickHouse queries, Goose migrations, chdb test schema, Weaviate collections/migrations, or telemetry storage paths.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
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.
Review the current conversation context and git changes, then persist durable repository knowledge into `dev-docs/*.md` by domain and into `AGENTS.md` for cross-cutting repo rules. Use after features, fixes, refactors, architecture changes, schema changes, or when the user mentions docs, documentation, design, architecture, business logic, conventions, or `AGENTS.md`.
Biome formatting, import style, strict TypeScript, naming (including React file names), or generated files.
Writing or debugging tests, choosing unit vs integration style, Postgres/ClickHouse tests, regenerating ClickHouse test schema, or exporting test helpers from packages without pulling test code into production bundles.
Queues and workers, domain event publishers, async notifications or projections, or not doing that work inside HTTP handlers.
apps/web UI — routes, @repo/ui, TanStack Start server functions and collections, forms (useForm + createFormSubmitHandler + fieldErrorsAsStrings for Zod field errors), Tailwind layout rules, design-system updates, and useEffect / useMountEffect policy.
| name | database-clickhouse-weaviate |
| description | ClickHouse queries, Goose migrations, chdb test schema, Weaviate collections/migrations, or telemetry storage paths. |
When to use: ClickHouse queries, Goose migrations, chdb test schema, Weaviate collections/migrations, 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 (CLICKHOUSE_CLUSTER_ENABLED=true)Goose tracks applied migrations automatically in the goose_db_version table (no manual registry).
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 timestamp-named files in both unclustered/ and clustered/)
pnpm --filter @platform/db-clickhouse ch:create <migration_name>
# Convert timestamp migrations to sequential order (run before merging a PR)
pnpm --filter @platform/db-clickhouse ch:fix
# 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 20260305120000_name.sql in both unclustered/ and clustered/ch:fix — renames timestamp files to the next sequential number (e.g. 00002_name.sql) and commits the renamed files.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.CLICKHOUSE_MIGRATION_MAX_RETRIES (default 20)CLICKHOUSE_MIGRATION_RETRY_DELAY_SECONDS (default 5)CLICKHOUSE_MIGRATION_MAX_RETRY_DELAY_SECONDS (default 30)CLICKHOUSE_MIGRATION_ALTER_SYNC (default 2)CLICKHOUSE_MIGRATION_DISTRIBUTED_DDL_TASK_TIMEOUT_SECONDS (default 300)CLICKHOUSE_MIGRATION_REPLICA_WAIT_TIMEOUT_SECONDS (default 300)Use the dedicated Weaviate package for connection and schema bootstrapping:
packages/platform/db-weaviate/src/client.ts — createWeaviateClient() and createWeaviateClientEffect() connect and perform health checks. For the general platform pattern (Effect-first client, tagged errors, env, layer wiring), see architecture-boundaries — Platform adapters: Effect-based clients.packages/platform/db-weaviate/src/collections.ts — define all collections in code via defineWeaviateCollections([...]).packages/platform/db-weaviate/src/migrations.ts — idempotent: checks collections.exists() before create and tolerates "already exists" race conditions.pnpm --filter @platform/db-weaviate wv:migrate — entrypoint is packages/platform/db-weaviate/src/migrate.ts.packages/platform/db-weaviate.src/collections.ts and rely on the package migration flow.Do not run wv:migrate unless the user explicitly asked in this conversation.