Generate offline with PGlite by default, including Windows and URI-configured projects - #54
Open
lucerowebcrafters wants to merge 1 commit into
Open
Conversation
…nfigured projects
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.
Fixes #2.
pgstrap generatenow runs migrations in a temporary PGlite database by default, so the scaffoldeddb:generatescript does not require a running PostgreSQL server.--no-pgliteretains generation from the configured PostgreSQL database.Two reproduced failures are also fixed:
ERR_UNSUPPORTED_ESM_URL_SCHEMEwhen importing its configuration. The import now uses a file URL, including for paths containing spaces or#.POSTGRES_URIandPG_URIoverrode the temporaryDATABASE_URL, redirecting schema dumps to an external server even with PGlite enabled. Dumping now uses the temporary database through the resolver's highest-priority input and restores that setting afterward.Generation calls are serialized because the dump dependency reads process-wide environment variables. Cleanup restores that environment and closes the temporary database, loopback listener, and sockets on success or failure. The CLI awaits completion and reports failures through its command handler.
Validation on Windows with Node 22.14.0 and Bun 1.2.6: seven tests pass, the production build passes, and formatting passes for the sixteen version-controlled source/configuration files. New tests run the built Node CLI, inspect generated TypeScript and SQL, verify the explicit PostgreSQL opt-out, recover from a dump failure, and check concurrent schema isolation. Baseline migration tests still emit the pre-existing Windows path warnings despite passing; the built CLI's configuration-import failure was separately reproduced and fixed.
This contribution was prepared with AI assistance. Is the advertised $30 bounty still available for this submission?