Skip to content

Make type generation work offline with PGlite and test the CLI - #60

Open
EEEEE213 wants to merge 1 commit into
seveibar:mainfrom
EEEEE213:fix/offline-type-generation
Open

Make type generation work offline with PGlite and test the CLI#60
EEEEE213 wants to merge 1 commit into
seveibar:mainfrom
EEEEE213:fix/offline-type-generation

Conversation

@EEEEE213

@EEEEE213 EEEEE213 commented Sep 8, 2026

Copy link
Copy Markdown

pgstrap generate and the initialized db:generate script now use in-memory PGlite by default, so types and SQL structure can be generated directly from migrations without a running PostgreSQL server. --no-pglite retains generation from the configured external database.

The integration tests also exposed a Bun/yargs initialization failure and Windows config-import failure; both are fixed. PGlite generation overrides all supported connection URI variables while dumping, restores them on failure, binds its gateway to loopback, and closes the temporary server and database.

Validation:

  • Bun 1.4.2: all 8 tests pass (27 assertions), including default/explicit PGlite, external PostgreSQL opt-out, invalid migrations, and environment restoration after output failure. Offline cases point all four connection URI variables at an unreachable database.
  • Built CommonJS CLI run with Node 24 on Windows: migration executed and both schema.d.ts and table.sql generated without PostgreSQL.
  • Build passes with TypeScript 5.9.3 installed locally. The unconstrained upstream install selects TypeScript 7.0.2, which crashes tsup 7's declaration builder; dependency files are unchanged.
  • Formatting of all changed TypeScript files and git diff --check pass. Repository-wide formatting still reports existing issues in untouched files.

AI-assisted implementation, locally tested. 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