feat: generate reviewed Oracle types and functions from catalogs - #108
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
Adds first-class Oracle dialect type support to typegres by introducing an Oracle catalog introspector + codegen pipeline, committing the generated type surface, and wiring the new typegres/oracle entrypoint into build/test/module-resolution configuration.
Changes:
- Add Oracle catalog introspection and a codegen entry (
src/types/oracle/{introspect,emit}.ts) plus committed generated Oracle type classes and targeted overrides. - Add Oracle smoke/introspection tests (gated by
ORACLE_URL) to validate generated method surfaces against a live Oracle instance. - Wire up the new Oracle entrypoint across tsconfig paths, Vitest aliases, build entries, and
package.jsonexports.
Reviewed changes
Copilot reviewed 15 out of 41 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| vitest.config.ts | Adds Vitest alias for typegres/oracle to resolve to the new Oracle barrel during tests. |
| tsdown.config.ts | Includes Oracle type entrypoint in build outputs. |
| tsconfig.json | Adds TS path mapping for typegres/oracle. |
| package.json | Exposes ./oracle export and adds codegen:oracle script. |
| src/types/oracle/smoke.test.ts | Integration smoke tests for generated Oracle types (skipped unless ORACLE_URL is set). |
| src/types/oracle/introspect.ts | Implements Oracle catalog introspection + ORACLE_URL parsing for codegen/tests. |
| src/types/oracle/introspect.test.ts | Tests introspection behavior (skipped unless ORACLE_URL is set). |
| src/types/oracle/emit.ts | Oracle codegen entrypoint: merges catalog facts + supplement and writes generated tree. |
| src/types/oracle/index.ts | Oracle barrel export (generated marker block) for typegres/oracle. |
| src/types/oracle/overrides/any.ts | Oracle root type override: dialect metadata + isNull/isNotNull/in. |
| src/types/oracle/overrides/bool.ts | Oracle Bool override: primitive acceptance, deserialize, and boolean operator helpers. |
| src/types/oracle/overrides/number.ts | Oracle Number override: accept JS numbers for params, hydrate as string for precision. |
| src/types/oracle/overrides/raw.ts | Oracle Raw override: accepts Uint8Array and decodes fetched raw text into bytes. |
| src/types/oracle/overrides/blob.ts | Oracle Blob override: accepts Uint8Array and decodes fetched blob text into bytes. |
| src/types/oracle/overrides/binary_float.ts | Oracle BinaryFloat override: number primitives + float parsing. |
| src/types/oracle/overrides/binary_double.ts | Oracle BinaryDouble override: number primitives + float parsing. |
| src/types/oracle/generated/any.ts | Generated Oracle Any method surface (scalar/aggregate/operator inventory). |
| src/types/oracle/generated/binary_double.ts | Generated Oracle BinaryDouble method surface and type chrome. |
| src/types/oracle/generated/binary_float.ts | Generated Oracle BinaryFloat method surface and type chrome. |
| src/types/oracle/generated/blob.ts | Generated Oracle Blob type chrome (plus any emitted methods). |
| src/types/oracle/generated/bool.ts | Generated Oracle Bool method surface and type chrome. |
| src/types/oracle/generated/char.ts | Generated Oracle Char type chrome. |
| src/types/oracle/generated/clob.ts | Generated Oracle Clob type chrome. |
| src/types/oracle/generated/date.ts | Generated Oracle Date method surface and type chrome. |
| src/types/oracle/generated/intervalds.ts | Generated Oracle IntervalDs method surface and type chrome. |
| src/types/oracle/generated/intervalym.ts | Generated Oracle IntervalYm method surface and type chrome. |
| src/types/oracle/generated/json.ts | Generated Oracle Json method surface and type chrome. |
| src/types/oracle/generated/nclob.ts | Generated Oracle Nclob type chrome. |
| src/types/oracle/generated/number.ts | Generated Oracle Number method surface and type chrome. |
| src/types/oracle/generated/nvarchar2.ts | Generated Oracle Nvarchar2 method surface and type chrome. |
| src/types/oracle/generated/raw.ts | Generated Oracle Raw method surface and type chrome. |
| src/types/oracle/generated/rowid.ts | Generated Oracle Rowid method surface and type chrome. |
| src/types/oracle/generated/time.ts | Generated Oracle Time method surface and type chrome. |
| src/types/oracle/generated/timestamp.ts | Generated Oracle Timestamp method surface and type chrome. |
| src/types/oracle/generated/timestampltz.ts | Generated Oracle Timestampltz method surface and type chrome. |
| src/types/oracle/generated/timestamptz.ts | Generated Oracle Timestamptz method surface and type chrome. |
| src/types/oracle/generated/timetz.ts | Generated Oracle Timetz method surface and type chrome. |
| src/types/oracle/generated/urowid.ts | Generated Oracle Urowid type chrome. |
| src/types/oracle/generated/varchar2.ts | Generated Oracle Varchar2 method surface and type chrome. |
| src/types/oracle/generated/vector.ts | Generated Oracle Vector type chrome. |
| src/types/oracle/generated/xmltype.ts | Generated Oracle XmlType type chrome. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Comment on lines
+5
to
+8
| override deserialize(raw: string): Uint8Array { | ||
| const hex = raw.startsWith("\\x") ? raw.slice(2) : raw; | ||
| return Uint8Array.from({ length: hex.length / 2 }, (_, i) => parseInt(hex.slice(i * 2, i * 2 + 2), 16)); | ||
| } |
Comment on lines
+5
to
+8
| override deserialize(raw: string): Uint8Array { | ||
| const hex = raw.startsWith("\\x") ? raw.slice(2) : raw; | ||
| return Uint8Array.from({ length: hex.length / 2 }, (_, i) => parseInt(hex.slice(i * 2, i * 2 + 2), 16)); | ||
| } |
Comment on lines
+381
to
+391
| export const requireOraclePoolAttributes = (): oracledb.PoolAttributes => { | ||
| const url = process.env["ORACLE_URL"]; | ||
| if (!url) { | ||
| throw new Error("ORACLE_URL is not set. Run bin/startora and export its URL before Oracle codegen."); | ||
| } | ||
| const m = /^([^/]+)\/([^@]+)@(.+)$/.exec(url); | ||
| if (!m) { | ||
| throw new Error(`ORACLE_URL must be user/password@host:port/service, got ${JSON.stringify(url)}`); | ||
| } | ||
| return { user: m[1]!, password: m[2]!, connectString: m[3]! }; | ||
| }; |
ryanrasti
force-pushed
the
oracle-types
branch
from
August 15, 2026 23:30
bb355cb to
c6e08e0
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.
No description provided.