feat: add native Oracle transactions - #110
Merged
Merged
Conversation
ryanrasti
force-pushed
the
oracle-transactions
branch
from
August 16, 2026 00:37
19af05a to
46b64a7
Compare
There was a problem hiding this comment.
Pull request overview
This PR refactors the driver transaction contract to a single runInTransaction(options, cb) entrypoint and adds native transaction support for the Oracle driver (including integration tests), while updating Connection.transaction() to delegate transaction boundaries to drivers.
Changes:
- Replace
runInSingleConnection/ optional native transaction hooks with requiredDriver.runInTransaction(opts, cb)and shared transaction helpers (runTransaction,runSqlTransaction). - Implement
runInTransactionacross pg/pglite/sqlite/do/oracle drivers and routeConnection.transaction()through the driver-owned transaction protocol. - Add/adjust tests for rollback behavior (DO sqlite live test) and add Oracle transaction coverage (opt-in via
ORACLE_URL).
Reviewed changes
Copilot reviewed 14 out of 14 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| src/test-helpers.ts | Updates compile-only driver stub to satisfy the new runInTransaction contract. |
| src/live/sqlite/db-live.test.ts | Exercises DO driver transaction behavior (commit + rollback) under live queries. |
| src/drivers/types.ts | Introduces TransactionOptions/TransactionIsolation and makes runInTransaction required. |
| src/drivers/transaction.ts | Adds shared transaction state machine + SQL begin/commit/rollback helper. |
| src/drivers/transaction.test.ts | Adds unit tests for the new transaction helpers. |
| src/drivers/sqlite.ts | Implements SQL-based transactions via runSqlTransaction. |
| src/drivers/pglite.ts | Implements SQL-based transactions with optional isolation handling. |
| src/drivers/pg.ts | Implements SQL-based transactions with pooled client pinning and optional isolation. |
| src/drivers/oracle.ts | Adds native Oracle transaction pinning + commit/rollback using oracledb APIs. |
| src/drivers/oracle.test.ts | Updates driver stub shape for the new runInTransaction API. |
| src/drivers/oracle-transaction.test.ts | Adds opt-in Oracle transaction integration tests (commit/rollback/nesting). |
| src/drivers/do.ts | Updates DO SqlStorage driver to the new runInTransaction(opts, cb(execute)) shape. |
| src/database.ts | Delegates transaction lifecycle to drivers and keeps nested isolation rules. |
| docs/ARCHITECTURE.md | Updates architecture docs to reflect the new driver transaction model and Oracle support. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Comment on lines
+41
to
+43
| const begin = opts.isolation | ||
| ? `BEGIN ISOLATION LEVEL ${opts.isolation.toUpperCase()}` | ||
| : "BEGIN"; |
Comment on lines
+44
to
+46
| const begin = opts.isolation | ||
| ? `BEGIN ISOLATION LEVEL ${opts.isolation.toUpperCase()}` | ||
| : "BEGIN"; |
ryanrasti
force-pushed
the
oracle-transactions
branch
from
August 16, 2026 01:01
46b64a7 to
1ca33d0
Compare
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.
Refactor
runInSingleConnectiontorunInTransaction-- drivers manage transactions themselves.