feat(db): export ClickHouse schema via @composiohq/db/clickhouse subpath
loading diff…
Follow-up to #10643. Makes the chorm-generated ClickHouse schema consumable from the dashboard repo (and anywhere else) via the existing @composiohq/db package — no new package needed.
./clickhouse subpath export on @composiohq/db → bundles src/clickhouse/schema.ts (previously dormant: generated by chorm but never exported or imported) as a second tsup entry (dist/clickhouse.*, ESM + CJS + dts)@composio/chorm (public npm — no GHP auth needed for it):
import { tool_execution_logs } from '@composiohq/db/clickhouse'
import type { InferRow } from '@composio/chorm'
type ToolExecutionLogRow = InferRow<typeof tool_execution_logs>
clickhouse:generate script documents the regen path (live introspection of production — the schema includes 40+ tables incl. PeerDB-synced ones that exist in no in-repo DDL, so it cannot be regenerated from clickhouse/schema.sql, which only has the 5 Apollo-owned tables with self-managed engines)tsconfig.bundle.json: the dts build needs Bundler moduleResolution to resolve chorm's .d.mts typings; the package tsconfig keeps legacy node resolution for everything elsepublish-db-lib-ghp.yml workflow untouched — the new entry is picked up automatically by pnpm bundlepnpm bundle builds all four artifacts (dist/clickhouse.{js,cjs,d.ts,d.cts})tool_execution_logs / metering_events_raw from the built bundle, derived rows via InferRow, asserted known column types compile and unknown columns are rejected🤖 Generated with Claude Code