ObsessionDB Overview
chkit ships a dedicated integration with ObsessionDB, the managed ClickHouse-compatible database that provides Shared engine variants and a hosted API for queries and backfills.
What it gives you
Section titled “What it gives you”- One schema, two targets — write
Shared*engines once and run them against ObsessionDB as-is, or against regular ClickHouse with theSharedprefix stripped automatically. - Service selection — list services across your organizations, pick a default per project, and override per command without touching config.
- Remote query execution — once a service is selected,
chkit queryand other SQL-emitting commands route through the ObsessionDB API instead of a local ClickHouse connection. - Remote backfills —
chkit backfillcan submit jobs to ObsessionDB rather than streaming chunks from your machine.
Install
Section titled “Install”bun add -d @chkit/plugin-obsessiondbRegister it in your clickhouse.config.ts:
import { defineConfig } from '@chkit/core'import { obsessiondb } from '@chkit/plugin-obsessiondb'
export default defineConfig({ schema: './src/db/schema/**/*.ts', outDir: './chkit', plugins: [obsessiondb()], clickhouse: { url: process.env.CLICKHOUSE_URL ?? 'http://localhost:8123', },})The plugin hooks into generate, migrate, status, drift, check, and query.
- Getting Started — sign up, authenticate, and select your first service.
- Engine Rewriting — how
Shared*engines are stripped for non-ObsessionDB targets. - Services — list, select, alias, and override services per command.
- Backfill Plugin — for backfills against ObsessionDB once a service is selected.