Skip to content

Use PGlite by default for type generation - #59

Open
vik319 wants to merge 1 commit into
seveibar:mainfrom
vik319:fix/pglite-default-generation
Open

Use PGlite by default for type generation#59
vik319 wants to merge 1 commit into
seveibar:mainfrom
vik319:fix/pglite-default-generation

Conversation

@vik319

@vik319 vik319 commented Sep 8, 2026

Copy link
Copy Markdown

Fixes #2.

Running db:generate now uses the existing in-memory PGlite implementation by default, so type and SQL generation no longer requires a running PostgreSQL server. Both the API and CLI use this default; --no-pglite retains the external database option. The CLI awaits generation, and configuration imports use a file URL so the built Node CLI can run on Windows.

The regression test covers both the default and explicit PGlite modes and checks that the generated schema contains the migrated table type. The README documents the default and opt-out.

Validation on Windows with Bun 1.4.2:

  • Default-mode regression failed before the fix with an unreachable external database URL and passed after it.
  • Full suite: 4 tests, 12 assertions passed.
  • tsup build and declaration generation passed.
  • Built CLI and bun run db:generate in a separate migration fixture succeeded with DATABASE_URL pointing to localhost port 1; generated SQL and TypeScript were inspected.
  • git diff --check passed.

The existing baseline also prints Windows path warnings during tests. Linux/macOS and the external PostgreSQL opt-out were not tested.

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