Use PGlite by default for CLI generation - #61
Open
ninomaaad wants to merge 3 commits into
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
bun run db:generatecreated bypgstrap initstill selects the external PostgreSQL path unless--pgliteis passed. Make CLI generation replay migrations in PGlite by default, so it creates the Zapatos declarations and SQL structure without a running PostgreSQL service.--no-pgliteexplicitly selects the existing configured-server path; programmatic callers retain their current default.The temporary gateway binds to localhost and closes its sockets/database on success or failure. The schema dumper uses the temporary connection even when a higher-priority
POSTGRES_URIis configured, then restores the original value. The CLI awaits generation so failures propagate through its command handler.Closes #2.
Validation
bun test --timeout 15000: 8 passed, 30 assertions. CLI tests build the package, initialize a fresh project and run its actualdb:generatescript with all connection URI variables pointing at an unavailable database. They check generated table/column content, explicit PostgreSQL opt-out, migration errors and output-write failure exit behavior.bun run build,bun run format:checkandgit diff --checkpassed. Patch application checked against the base commit.The live PostgreSQL success path and concurrent programmatic PGlite calls were not tested. PGlite-specific extension limitations remain;
--no-pglitesupports opting back into an existing server.Prepared with AI assistance; the listed checks were executed locally.
/claim #2