Skip to content

feat: add PostgreSQL query-store foundation (#148) - #156

Merged
atomantic merged 1 commit into
mainfrom
claim/issue-148
Aug 25, 2026
Merged

feat: add PostgreSQL query-store foundation (#148)#156
atomantic merged 1 commit into
mainfrom
claim/issue-148

Conversation

@atomantic

Copy link
Copy Markdown
Owner

Summary

  • add an idempotent PostgreSQL baseline for the complete derived query-store model using native boolean, timestamptz, jsonb, identity, and tsvector/GIN types
  • add a lazy async pg service with named-parameter compilation, availability checks, transactional schema initialization, and deterministic pool shutdown
  • package both SQL schemas, pass DATABASE_URL through PM2 without storing credentials, and document the staged rollout
  • keep the current SQLite/JSON runtime unchanged until later Migrate query store from SQLite (better-sqlite3) to PostgreSQL #120 slices migrate writers and readers

Test plan

  • npm run build
  • full Vitest suite under the repository's compatible Node 24 SQLite ABI: 175 passed, 2 skipped
  • npm test -- --run tests/unit (120 passed)
  • SPARSETREE_TEST_DATABASE_URL='postgresql:///postgres?host=/tmp' npm test -- --run tests/integration/db/postgresSchema.spec.ts (2 passed against live PostgreSQL; temporary schema removed)
  • npm run check:file-sizes
  • git diff --check

Part of #120

Closes #148

@atomantic
atomantic merged commit 599562a into main Aug 25, 2026
4 checks passed
@atomantic
atomantic deleted the claim/issue-148 branch August 25, 2026 17:44
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.

Add PostgreSQL schema and connection foundation

1 participant