Skip to content

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.

  • One schema, two targets — write Shared* engines once and run them against ObsessionDB as-is, or against regular ClickHouse with the Shared prefix 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 query and other SQL-emitting commands route through the ObsessionDB API instead of a local ClickHouse connection.
  • Remote backfillschkit backfill can submit jobs to ObsessionDB rather than streaming chunks from your machine.
Terminal window
bun add -d @chkit/plugin-obsessiondb

Register 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.