Skip to content

feat: add native Oracle transactions - #110

Merged
ryanrasti merged 1 commit into
mainfrom
oracle-transactions
Aug 16, 2026
Merged

feat: add native Oracle transactions#110
ryanrasti merged 1 commit into
mainfrom
oracle-transactions

Conversation

@ryanrasti

@ryanrasti ryanrasti commented Aug 16, 2026

Copy link
Copy Markdown
Owner

Refactor runInSingleConnection to runInTransaction -- drivers manage transactions themselves.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 required Driver.runInTransaction(opts, cb) and shared transaction helpers (runTransaction, runSqlTransaction).
  • Implement runInTransaction across pg/pglite/sqlite/do/oracle drivers and route Connection.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 thread src/drivers/pg.ts Outdated
Comment on lines +41 to +43
const begin = opts.isolation
? `BEGIN ISOLATION LEVEL ${opts.isolation.toUpperCase()}`
: "BEGIN";
Comment thread src/drivers/pglite.ts Outdated
Comment on lines +44 to +46
const begin = opts.isolation
? `BEGIN ISOLATION LEVEL ${opts.isolation.toUpperCase()}`
: "BEGIN";
@ryanrasti
ryanrasti force-pushed the oracle-transactions branch from 46b64a7 to 1ca33d0 Compare August 16, 2026 01:01
@ryanrasti
ryanrasti merged commit 2ebfe3c into main Aug 16, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants