Skip to content

Async persistence, PostgreSQL default, pgvector image, separated integration tier#28

Merged
tomasanchez merged 2 commits into
mainfrom
feat/async-postgres
Jun 12, 2026
Merged

Async persistence, PostgreSQL default, pgvector image, separated integration tier#28
tomasanchez merged 2 commits into
mainfrom
feat/async-postgres

Conversation

@tomasanchez

Copy link
Copy Markdown
Owner

Async-only persistence + PostgreSQL default + separated integration tier

New scope requested on top of the Copier template (epic #24), recorded as three ADRs:

  • ADR 0017 — async by default (supersedes ADR 0006). The whole persistence/service/entrypoint stack is async (create_async_engine, AsyncSession, async UoW/repositories/queries/handlers/routes, async Alembic); the domain stays synchronous.
  • ADR 0018PostgreSQL is the default (asyncpg) with a pgvector/pgvector docker-compose service (image only, no vector column); SQLite (aiosqlite) optional via a Copier database choice.
  • ADR 0019 — the 100% coverage gate runs offline from unit (mocked) + e2e (in-memory async SQLite) for both DB choices; the real-Postgres integration tier is marked, skipped offline, and runs in a separate CI job with a pgvector service.

Validation

  • Offline bake matrix database × include_user_example = 4 combos, all green at 100% (ruff, ruff format, pyrefly, pytest). Independently re-run: 18 passed.
  • Real Postgres (Docker pgvector/pgvector:pg17): integration tier 9 passed (User on) / 4 passed (User off); alembic upgrade head over asyncpg verified.
  • Tests use in-memory aiosqlite regardless of the chosen runtime DB, so the gate stays offline and fast even for Postgres projects.

Note

Adds concurrency = ["thread", "greenlet"] to the generated coverage config (load-bearing for measuring post-await branches under SQLAlchemy's greenlet bridge) — documented in ADR 0019.

Refs #24

🤖 Generated with Claude Code

tomasanchez and others added 2 commits June 12, 2026 19:20
ADR 0017 makes async the default and supersedes ADR 0006; ADR 0018 makes PostgreSQL (asyncpg, pgvector image) the default with SQLite (aiosqlite) optional; ADR 0019 takes coverage from unit+e2e and moves the Docker integration tier to a separate CI stage. copier.yml gains a database choice (postgres default) and an async, conditional database_url.

Refs #24

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…gration tier

Convert the whole persistence/service/entrypoint stack to async (create_async_engine, AsyncSession, async UoW/repositories/queries/handlers/routes, async Alembic) per ADR 0017; domain stays synchronous. Default to PostgreSQL via asyncpg with a pgvector/pgvector docker-compose service, SQLite (aiosqlite) optional, per ADR 0018. Per ADR 0019, the 100% coverage gate runs offline from unit (mocked) + e2e (in-memory async SQLite) for both database choices, while the real-Postgres integration tier is marked, skipped offline, and runs in a separate CI job.

Bake matrix extended to database x include_user_example (4 combos), all green offline at 100%; integration tier verified against a real pgvector Postgres.

Refs #24

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@tomasanchez tomasanchez merged commit c943e09 into main Jun 12, 2026
3 checks passed
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