Skip to content

feat: use pglite by default for type generation - #84

Open
aipd506 wants to merge 1 commit into
seveibar:mainfrom
aipd506:feat/pglite-typegen
Open

aipd506 wants to merge 1 commit into
seveibar:mainfrom
aipd506:feat/pglite-typegen

Conversation

@aipd506

@aipd506 aipd506 commented Oct 3, 2026

Copy link
Copy Markdown

Overview

Resolves issue #2 by defaulting type generation to an in-memory PGlite instance, allowing bun run db:generate to run hermetically without requiring a background PostgreSQL server.

Summary of Changes

  1. Updated generate in src/generate.ts so that pglite defaults to true.
  2. Wrapped PGlite database and pg-gateway server execution in a try ... finally block to guarantee server shutdown and database closure.
  3. Updated CLI generate command in src/cli.ts to default --pglite to true, providing --no-pglite as an explicit opt-out to generate against external PostgreSQL.
  4. Added unit test in tests/generate.pglite.test.ts verifying that omitting pglite runs migrations and generates types through PGlite.
  5. Updated README.md documentation to describe default in-memory type generation and the --no-pglite opt-out.

Claim

Verified profile: https://terminal.merit.systems/aipd506
/claim #2

1. Default pglite parameter to true in generate function.

2. Default pglite CLI option to true in pgstrap generate command.

3. Clean up PGlite database and pg-gateway server inside finally block.

4. Update README documentation to describe in-memory generation and --no-pglite opt out.

5. Add unit test verifying generate defaults to pglite without external PostgreSQL.
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