Skip to content

Default type generation to PGlite and clean up the temporary gateway - #87

Open
woahwhattheheck wants to merge 1 commit into
seveibar:mainfrom
woahwhattheheck:fix/pglite-default-2-lantern-20261004
Open

woahwhattheheck wants to merge 1 commit into
seveibar:mainfrom
woahwhattheheck:fix/pglite-default-2-lantern-20261004

Conversation

@woahwhattheheck

Copy link
Copy Markdown

Running bun run db:generate currently requires an external PostgreSQL service unless PGlite is selected explicitly. This makes the existing embedded migration path the CLI and library default, with --no-pglite and pglite: false available for generating from an external database.

The temporary gateway binds to loopback and restores DATABASE_URL, closes client sockets and the listener, and closes PGlite even when generation fails. The CLI now initializes the Yargs factory correctly and awaits generation errors. README guidance explains the migration-based default.

Regression coverage executes the default package-script command and direct API against an unreachable DATABASE_URL, checks the generated types and SQL, and exercises failed-output cleanup.

Validation on the submitted head e6245173da35822f74c788dfe8aecea674c4c295 with Bun 1.4.2 on Linux:

  • bun install --frozen-lockfile: passed.
  • bun test: 6 passed, 0 failed.
  • bun run build: passed, including declaration generation.
  • bun run format:check and git diff --check: passed.

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

1 participant