Skip to content

feat: add Postgres storage adapter#388

Open
jamemackson wants to merge 2 commits intomattpocock:mainfrom
spacethree:feat/postgres-storage
Open

feat: add Postgres storage adapter#388
jamemackson wants to merge 2 commits intomattpocock:mainfrom
spacethree:feat/postgres-storage

Conversation

@jamemackson
Copy link
Copy Markdown

Summary

Implements the Postgres storage adapter requested in #222. Enables persisting eval results to PostgreSQL for team-wide visibility and CI/CD durability.

  • Add createPostgresStorage() in evalite/postgres-storage implementing the full Evalite.Storage interface
  • Support both connection string and individual connection parameters (host, port, database, user, password, ssl, maxConnections)
  • Use postgres.js as an optional peer dependency — zero native deps, native JSONB handling
  • Register in multi-adapter test suite (conditional on EVALITE_TEST_POSTGRES_URL)
  • Add Storage guide to docs with DDL, config examples, and options reference
    Include minor changeset

Design decisions

  • No auto-migration — consumers provide their own DDL (documented in the storage guide)
  • search_path set at connection level — ensures all connections in the pool resolve unqualified table names correctly
  • undefined → null coercion for JSON fields — postgres.js rejects undefined values, so the adapter normalizes them

Test plan

  • pnpm run ci passes (build, 160 unit tests, lint, format)
  • With EVALITE_TEST_POSTGRES_URL set, all 70 storage tests pass against Postgres alongside SQLite and InMemory
  • evalite run persists results to Postgres and evalite serve reads them back in the UI
  • Docs preview: Storage guide renders correctly in sidebar under Guides > Storage

Closes #222

…s adapter

Support individual connection parameters (host, port, database, user,
password, ssl, maxConnections) as an alternative to connection strings,
aligning with the spec in mattpocock#222. Add storage guide to docs, update
configuration reference, and include minor changeset.
@changeset-bot
Copy link
Copy Markdown

changeset-bot bot commented Apr 11, 2026

🦋 Changeset detected

Latest commit: 11b438e

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
evalite Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@vercel
Copy link
Copy Markdown

vercel bot commented Apr 11, 2026

@jamemackson is attempting to deploy a commit to the Skill Recordings Team on Vercel.

A member of the Team first needs to authorize it.

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.

Adapter: Implement Postgres adapter

1 participant