Skip to content

feat(generate): default to PGlite so type generation needs no Postgres server - #86

Open
stffinfcti wants to merge 1 commit into
seveibar:mainfrom
stffinfcti:devin/pglite-default-generate
Open

stffinfcti wants to merge 1 commit into
seveibar:mainfrom
stffinfcti:devin/pglite-default-generate

Conversation

@stffinfcti

Copy link
Copy Markdown

Closes #2 — bun run db:generate should not need Postgres running in the background.

What changed

  • pgstrap generate now defaults --pglite to true: migrations run against an embedded PGlite instance and types/structure are generated through the built-in pg-gateway socket — no local Postgres required.
  • pgstrap generate --no-pglite restores the previous behavior and introspects the database configured via DATABASE_URL / pg env vars.
  • generate()'s pglite parameter defaults to true for parity between the CLI and the library API.
  • README updated to document the new default and the --no-pglite opt-out.

Tests

  • Added tests/generate.default.test.ts: calls generate() with no pglite option and asserts zapatos + structure output is produced — a regression test proving the default path needs no Postgres server.

Verification

  • bun test — 4/4 pass (including the new test)
  • bun run build — success
  • bun run format:check — clean

@algora-pbc /claim #2


Disclosure: this contribution was prepared with AI assistance (Devin agent) and reviewed for correctness by running the full test suite, build, and formatter locally.

pgstrap generate now uses the embedded PGlite path by default, so
`bun run db:generate` works without a running Postgres instance.
Pass --no-pglite to introspect the database configured via
DATABASE_URL, as before.

Closes seveibar#2
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