Skip to content

fix: default generate to PGlite (no Postgres required) - #58

Open
theatlasteam wants to merge 6 commits into
seveibar:mainfrom
theatlasteam:fix/pglite-default-generate
Open

fix: default generate to PGlite (no Postgres required)#58
theatlasteam wants to merge 6 commits into
seveibar:mainfrom
theatlasteam:fix/pglite-default-generate

Conversation

@theatlasteam

Copy link
Copy Markdown

Fixes #2
@algora-pbc /claim #2

Summary

  • Default generate() and pgstrap generate to PGlite so generation works without a running PostgreSQL server.
  • Add --no-pglite / pglite: false support for external PostgreSQL.
  • Close the PGlite gateway and database and restore DATABASE_URL, POSTGRES_URI, and PG_URI in all cases.
  • Scaffold db:generate for PGlite and document the default and opt-out behavior.
  • Add a regression test covering default generation and environment restoration.

Test plan

  • With no Postgres running: pgstrap generate (or bun run db:generate after init) succeeds
  • With no Postgres running: bun test tests/generate.defaults.test.ts
  • External PostgreSQL remains available with pgstrap generate --no-pglite

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.

Use pglite so that postgres isn't required when generating types

1 participant