Skip to content

Use PGlite by default for type generation - #62

Open
stantheman0128 wants to merge 1 commit into
seveibar:mainfrom
stantheman0128:codex/pglite-generation-default
Open

Use PGlite by default for type generation#62
stantheman0128 wants to merge 1 commit into
seveibar:mainfrom
stantheman0128:codex/pglite-generation-default

Conversation

@stantheman0128

Copy link
Copy Markdown

db:generate currently scaffolds a plain pgstrap generate command, which defaults to an external Postgres connection even though the PGlite implementation is already available. This makes PGlite the default in both the CLI and programmatic generator. --no-pglite and pglite: false retain explicit generation from an existing database.

The existing integration test now checks both the default and explicitly enabled PGlite paths, including generated type and SQL files. The README explains migration-based generation, external-database selection, and the Node 20+ runtime used for CLI validation.

Validation in an isolated Linux environment with Bun 1.3.9:

  • Unmodified implementation: explicit PGlite test passes; default-generation regression fails with ECONNREFUSED against an unavailable external Postgres endpoint.
  • Patched implementation: bun test passes all 4 tests; bun run build (including declarations) and bun run format:check pass.
  • Built CLI on Node 20.19.0: bun run db:generate produces schema.d.ts and table.sql from a fixture migration with no external Postgres server. A separate --no-pglite check attempts the configured unavailable external endpoint as expected.
  • Node 18.19.1 CLI smoke failed in the gateway's use of global Web Crypto; Node 20+ is documented. Other runtime/platform combinations were not tested.

Implemented and tested with OpenAI Codex assistance.

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