Skip to content

feat(plugin-obsessiondb): query routing through ObsessionDB API#103

Merged
KeKs0r merged 2 commits intomainfrom
marc/obsessiondb-query-routing
Mar 29, 2026
Merged

feat(plugin-obsessiondb): query routing through ObsessionDB API#103
KeKs0r merged 2 commits intomainfrom
marc/obsessiondb-query-routing

Conversation

@KeKs0r
Copy link
Copy Markdown
Contributor

@KeKs0r KeKs0r commented Mar 29, 2026

Summary

  • Add PluginContext with getContext hook so plugins can replace the ClickHouse executor
  • Core commands (migrate, status, drift, check) now use ctx.executor from plugin context instead of withClickHouseExecutor
  • ObsessionDB plugin provides a remote executor that proxies queries through the platform API when authenticated with a selected service
  • Add per-project service binding (.chkit/obsessiondb.json), interactive service selection during chkit obsessiondb login, and select-service command
  • Extract shared apiRequest helper from backfill into api-request.ts

Test plan

  • bun verify passes (typecheck + lint + test)
  • Manual: chkit obsessiondb login authenticates and prompts for service selection
  • Manual: chkit obsessiondb select-service re-picks service without re-auth
  • Manual: chkit migrate --apply routes through ObsessionDB when service selected
  • Manual: Commands fall back to direct ClickHouse when no service selected

🤖 Generated with Claude Code

KeKs0r and others added 2 commits March 29, 2026 16:31
Add plugin context infrastructure so plugins can replace the ClickHouse
executor via a `getContext` hook. Core commands (migrate, status, drift,
check) now receive the executor from `CommandRunContext.ctx` instead of
creating their own via `withClickHouseExecutor`.

The ObsessionDB plugin uses this to route queries through the platform
API when the user is authenticated and has a selected service. Adds
per-project service binding (`.chkit/obsessiondb.json`), interactive
service selection during login, a `select-service` command, and a remote
executor that proxies all ClickHouse operations through the ObsessionDB
query API.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Prevent ClickHouse TCP connection leak when a plugin's getContext hook
throws — the eagerly-opened default executor was never closed because
the caller's finally/disposeContext block requires a returned context.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@KeKs0r KeKs0r merged commit c8af201 into main Mar 29, 2026
2 checks passed
@KeKs0r KeKs0r deleted the marc/obsessiondb-query-routing branch March 29, 2026 14:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant