feat: add Oracle driver (thin oracledb) and :n placeholders - #106
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
Adds an initial Oracle dialect/driver integration so typegres can compile Oracle-style bind parameters and run statement-only connections without accidentally enabling sqlite live behavior.
Changes:
- Extend
DialectNamewith"oracle"and emit Oracle:nbind placeholders during SQL compilation. - Add a thin-mode
node-oracledb-backedOracleDriverthat normalizes all result values tostring | null, plus smoke tests gated byORACLE_URL. - Ensure non-live dialects use a statement-only executor and add local dev scripts (
bin/startora,bin/stopora) for booting an Oracle container.
Reviewed changes
Copilot reviewed 12 out of 16 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| vitest.config.ts | Adds a Vitest path alias for the Oracle driver entrypoint. |
| tsdown.config.ts | Ensures the Oracle driver is built and oracledb stays external (never bundled). |
| tsconfig.json | Adds TS path mapping for typegres/drivers/oracle. |
| src/oracle.ts | Adds requireOracleUrl() helper for Oracle smoke tests (and future tooling). |
| src/live/canonical.ts | Makes canonicalText() explicitly reject the new oracle dialect (live-only). |
| src/index.ts | Updates usage comment to include the new OracleDriver import. |
| src/executor.ts | Introduces StatementExecutor for dialects without live support. |
| src/drivers/oracle.ts | Implements OracleDriver using thin node-oracledb, with string/hex normalization. |
| src/drivers/oracle.test.ts | Adds always-on constructor/compile tests + ORACLE_URL-gated integration smoke tests. |
| src/database.ts | Routes unknown/non-live dialects to StatementExecutor and improves live()/transaction() errors. |
| src/builder/sql.ts | Adds "oracle" dialect and :n parameter placeholder compilation. |
| src/builder/sql.test.ts | Adds unit test coverage for Oracle placeholder compilation. |
| package.json | Exposes ./drivers/oracle and adds optional peer dependency metadata for oracledb. |
| package-lock.json | Locks oracledb and @types/oracledb additions. |
| bin/stopora | Adds helper script to stop the local Oracle container. |
| bin/startora | Adds helper script to start/reuse an Oracle container and print ORACLE_URL. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Comment on lines
345
to
347
| } else { | ||
| // The constructor rejects async sqlite drivers at attach — this | ||
| // branch exists so TS narrows `driver` above. | ||
| throw new Error("unreachable: sqlite Connection without a SyncDriver"); | ||
| txExecutor = new StatementExecutor(this.database, execute, true); | ||
| } |
Comment on lines
+34
to
+38
| const toHex = (bytes: Uint8Array): string => { | ||
| let s = "\\x"; | ||
| for (const b of bytes) { s += b.toString(16).padStart(2, "0"); } | ||
| return s; | ||
| }; |
First slice of Oracle support: DialectName grows "oracle", compile emits :n binds, and OracleDriver talks thin-mode node-oracledb with fetchAsString so rows stay raw text. Connection construction no longer treats a non-pg dialect as sqlite — StatementExecutor runs statements and live() throws. Live FROM DUAL tests skip unless ORACLE_URL is set. bin/startora boots gvenzl/oracle-free:23-slim-faststart for local work.
ryanrasti
force-pushed
the
oracle-driver
branch
from
August 15, 2026 21:44
2c9ceff to
a2f7b9b
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.
First slice of Oracle support: DialectName grows "oracle", compile emits :n binds, and OracleDriver talks thin-mode node-oracledb with fetchAsString so rows stay raw text. Connection construction no longer treats a non-pg dialect as sqlite — StatementExecutor runs statements and live() throws.
Live FROM DUAL tests skip unless ORACLE_URL is set. bin/startora boots gvenzl/oracle-free:23-slim-faststart for local work.