Superseded by existing upstream PR #30#1
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 029dbe0852
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| migrationsDir = migrationsDir ?? path.join(dbDir, "migrations") | ||
|
|
||
| if (pglite) { | ||
| if (shouldUsePglite(pglite)) { |
There was a problem hiding this comment.
Restore PGlite state when generation fails
When pglite is omitted, this now sends normal generate() calls into the PGlite branch, but that branch mutates process.env.DATABASE_URL and opens a TCP server and only restores/closes them after both zg.generate and dumpTree succeed. In a programmatic caller or test runner that catches a generation error, such as a schema dump failure, the process is left pointed at the transient PGlite URL with the server still listening, so later DB work can hit the wrong database or the process can hang; wrap the PGlite work in try/finally before making it the default.
Useful? React with 👍 / 👎.
Closed without upstream submission because seveibar/pgstrap already has an active claimed pull request (seveibar#30) implementing the same bounty issue.