[codex] Add transaction helpers - #28
Conversation
1b4044f to
e72fb0c
Compare
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: e72fb0c02d
ℹ️ 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".
|
@codex review |
|
Codex Review: Didn't find any major issues. 🚀 ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
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". |
11de0ca to
9aa24dc
Compare
|
@codex review |
|
Codex Review: Didn't find any major issues. Bravo. ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
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". |
Summary
Adds small ReScript transaction helpers for the existing
pgbindings:Pg.Client.transaction(client, callback)sendsBEGIN, runs the callback, commits on success, and rolls back/rethrows on failure.Pg.Pool.transaction(pool, callback)checks out a client, delegates toClient.transaction, and releases the client on both success and failure.src/res/PgTyped.jsruntime sibling required by the example test runtime.RESCRIPT.md.Refs #2.
Supersedes #27.
Validation
npm run buildnpm test --workspace packages/cli -- --runInBandnpm run lint -- --project packages/cli/tsconfig.jsonnpm run build --workspace packages/examplenode -e "require('./packages/cli/src/res/PgTyped.js'); console.log('ok')"I also attempted
npm test --workspace packages/example, but the Docker run is blocked locally on Apple Silicon: the container reportsPackage @rescript/linux-x64 not foundduring typegen and then the follow-up test container waits on Postgres. I stopped and cleaned up the compose containers withdocker compose down --remove-orphans.