Files
momentum devandClaude Opus 4.8 c4669fe0ce WS0: migrate datastore DuckDB -> PostgreSQL (psycopg2)
- storage/db_pg.py: thin psycopg2 connection shim (?->%s translation,
  autocommit, .df(), and per-test isolated schema for ':memory:').
- storage/db.py: delegate get_connection/get_memory_connection to db_pg.
- storage/pg_schema.sql: Postgres schema, applied on connect.
- research/query.py runs UNMODIFIED on Postgres via the shim.
- ingestion upserts: INSERT OR REPLACE -> INSERT ... ON CONFLICT DO UPDATE.
- event_store: drop invalid btree-on-JSON-text index.

Full logic suite: 67/67 green against Postgres (was DuckDB).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-15 23:48:35 -04:00

14 lines
553 B
Python

"""Database connection management.
The momentum datastore is a single PostgreSQL database. This module preserves
the historical ``get_connection`` / ``get_memory_connection`` entry points but
delegates to :mod:`storage.db_pg`. The ``db_path`` argument is accepted for
call-site compatibility and ignored, except that ":memory:" yields an isolated
throwaway schema (the DuckDB ':memory:' equivalent) so each test gets a fresh
database.
"""
from .db_pg import get_connection, get_memory_connection
__all__ = ["get_connection", "get_memory_connection"]