Skip to content

feat(postgres): add @aizvi/auth-postgres package - #12

Closed
ahmadhuss wants to merge 1 commit into
mainfrom
feat/postgres-package
Closed

feat(postgres): add @aizvi/auth-postgres package#12
ahmadhuss wants to merge 1 commit into
mainfrom
feat/postgres-package

Conversation

@ahmadhuss

@ahmadhuss ahmadhuss commented Aug 1, 2026

Copy link
Copy Markdown
Member

Summary

  • Adds a new @aizvi/auth-postgres package, a PostgreSQL storage adapter for @aizvi/auth backed by pg, following the same pattern as @aizvi/auth-sqlite.
  • postgresAdapter({ connectionString }) opens its own pg.Pool; createPostgresAuthAdapter(db) also works with any already-open client matching the query(text, params) => { rows } shape, including pg.Pool, pg.Client, or @electric-sql/pglite.
  • Unit tests run against @electric-sql/pglite (a real Postgres compiled to WASM), so the suite needs no Postgres server or Docker.
  • Detailed, beginner-friendly README for the new package (quick start, reusing an existing connection, running the migration ahead of time, testing without a server, using this alongside Prisma).
  • Root and core package READMEs updated to list/link the new package.
  • Adds a changeset for the initial @aizvi/auth-postgres release.

Test plan

  • bun run build (all three packages)
  • bun run typecheck (all three packages)
  • bun run lint
  • bun run test (core, sqlite, postgres all pass, including 6 new adapter tests against pglite)

New PostgreSQL storage adapter for @aizvi/auth, backed by pg. postgresAdapter()
opens its own connection pool from a connection string; createPostgresAuthAdapter()
also works with any already-open client matching the query(text, params) => { rows }
shape, including pg.Pool, pg.Client, and @electric-sql/pglite. Unit tests run against
pglite, a real Postgres compiled to WASM, so no server or Docker is needed in CI.

Also updates the root and core package docs to reference the new package, and adds
a changeset for the initial release.
@ahmadhuss
ahmadhuss force-pushed the feat/postgres-package branch from 2644e19 to 85c643e Compare August 1, 2026 05:18
@ahmadhuss

Copy link
Copy Markdown
Member Author

Closing and reopening as a fresh PR to fully clean the branch history (removing an unwanted attribution trailer that persisted across a force-push).

@ahmadhuss ahmadhuss closed this Aug 1, 2026
@ahmadhuss
ahmadhuss deleted the feat/postgres-package branch August 1, 2026 05:24
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