[codex] Add transaction helpers - #27
Conversation
0992b97 to
02ec316
Compare
a9a695b to
14dca18
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 14dca182ea
ℹ️ 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".
| await client->Client.release | ||
| result | ||
| } catch { | ||
| | exn => | ||
| await client->Client.release |
There was a problem hiding this comment.
Avoid releasing the same pooled client twice
The pool transaction helper releases the client in both the try path and the catch path, so if client.release itself throws in the success path, control enters catch and calls release again on the same client. In that scenario the second call can raise a secondary "already released" error and mask the original failure, making error handling misleading and harder to debug. A finally-based single-release flow avoids this double-release path.
Useful? React with 👍 / 👎.
| dbUser ++ | ||
| ":" ++ | ||
| dbPassword ++ | ||
| "@" ++ | ||
| dbHost ++ |
There was a problem hiding this comment.
Encode fallback connection string components
The fallback DATABASE_URL is assembled by raw string concatenation of dbUser, dbPassword, and host/database segments. If credentials contain reserved URL characters (for example @, :, /, #, %), the resulting URI becomes invalid or is parsed incorrectly, so pool creation can fail in environments where direct config-based client connection still works. Use URL encoding (or pass a config object) when constructing this fallback.
Useful? React with 👍 / 👎.
Superseded by #28.
The original CI failure was caused by omitting the generated
packages/cli/src/res/PgTyped.jsruntime file. The replacement PR includes that file and should get a fresh Actions run from a new PR open event.