Skip to content

Generate from embedded PGlite by default in the CLI - #82

Open
qorud02 wants to merge 5 commits into
seveibar:mainfrom
qorud02:codex/pgstrap-embedded-default
Open

qorud02 wants to merge 5 commits into
seveibar:mainfrom
qorud02:codex/pgstrap-embedded-default

Conversation

@qorud02

@qorud02 qorud02 commented Oct 2, 2026

Copy link
Copy Markdown

Changes

db:generate now runs migrations in PGlite by default, so it can generate schema types and SQL without a PostgreSQL server. --no-pglite still selects the configured PostgreSQL database, and the direct generate() API keeps its existing default.

  • Convert the config path to a file URL for dynamic import on Windows.
  • Bind the embedded database gateway to 127.0.0.1.
  • Document the CLI default and add a CLI regression test using an unreachable DATABASE_URL.

Verification

I ran the actual bundled CLI on Windows with Node. With the original configuration loader it failed with ERR_UNSUPPORTED_ESM_URL_SCHEME; with the loader fixed and the previous CLI default it tried the unreachable PostgreSQL address. The final default generated both the type file and SQL dump containing the migrated table. --no-pglite selected the external database as expected. All eight checks passed. Biome and git diff --check passed.

The Bun test runner was unavailable locally, so the new Bun regression test has not been run locally.

Fixes #2

@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