Skip to content

Fix initialized type generation to use PGlite - #88

Open
jyxray wants to merge 1 commit into
seveibar:mainfrom
jyxray:fix/init-generate-pglite
Open

jyxray wants to merge 1 commit into
seveibar:mainfrom
jyxray:fix/init-generate-pglite

Conversation

@jyxray

@jyxray jyxray commented Oct 6, 2026 •

Copy link
Copy Markdown

New projects currently scaffold db:generate as pgstrap generate, which connects to an external PostgreSQL server. Scaffold pgstrap generate --pglite instead so the existing embedded database implementation runs migrations and generates Zapatos types and SQL structure without a running PostgreSQL server.

The direct CLI command and programmatic defaults retain their existing behavior. The README explains how to generate from a running database when desired.

Adds an integration regression test that builds the published CLI, initializes a fixture project, runs the scaffolded generation arguments in a fresh process with an unreachable external PostgreSQL URL, and checks the generated types and SQL. The new test fails on the original implementation and passes with this change.

Validation on Windows with Bun 1.4.2 and the frozen upstream lockfile:

  • bun test: 4 passed, 0 failed.
  • bun run build: passed, including declaration generation.
  • bun run format:check: passed.
  • git diff --check: passed.

AI-assisted contribution, tested locally.

Fixes #2.

/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

2 participants