Skip to content

Use PGlite for generated db:generate script#21

Open
SimoneMariaRomeo wants to merge 1 commit into
seveibar:mainfrom
SimoneMariaRomeo:codex/pglite-generate-hardened
Open

Use PGlite for generated db:generate script#21
SimoneMariaRomeo wants to merge 1 commit into
seveibar:mainfrom
SimoneMariaRomeo:codex/pglite-generate-hardened

Conversation

@SimoneMariaRomeo
Copy link
Copy Markdown

@SimoneMariaRomeo SimoneMariaRomeo commented May 13, 2026

Summary

  • make newly initialized db:generate scripts run pgstrap generate --pglite, so bun run db:generate no longer needs a local Postgres service
  • document the generated script behavior while keeping pgstrap generate as the explicit configured-Postgres path
  • wrap the temporary PGlite gateway in cleanup so DATABASE_URL is restored and the server is closed after generation
  • add coverage for the generated script and DATABASE_URL restoration

Fixes #2

Verification

  • bunx biome format README.md src/generate.ts src/init.ts tests/generate.pglite.test.ts tests/init.test.ts
  • bun test
  • bun run build

Note: full bun run format:check rewrites untouched files on Windows because the checkout has CRLF line endings, so I limited formatting to the changed files.

@algora-pbc /claim #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