Skip to content

feat: generate reviewed Oracle types and functions from catalogs - #108

Merged
ryanrasti merged 1 commit into
mainfrom
oracle-types
Aug 15, 2026
Merged

feat: generate reviewed Oracle types and functions from catalogs#108
ryanrasti merged 1 commit into
mainfrom
oracle-types

Conversation

@ryanrasti

Copy link
Copy Markdown
Owner

No description provided.

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

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.json exports.

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 thread src/types/oracle/overrides/raw.ts Outdated
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 thread src/types/oracle/overrides/blob.ts Outdated
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 thread src/types/oracle/introspect.ts Outdated
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 ryanrasti changed the title Oracle types feat: generate reviewed Oracle types and functions from catalogs Aug 15, 2026
@ryanrasti
ryanrasti merged commit f29e62e into main Aug 15, 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