Skip to content

v1.0.0

Choose a tag to compare

@github-actions github-actions released this 02 Nov 08:09
· 21 commits to main since this release

First release: a Java 17 JDBC driver and PostgreSQL SQL runtime that absorb the Oracle SQL and JDBC differences Java applications rely on.

Orafit lets an existing Oracle-oriented Java application run on PostgreSQL through pgJDBC. It does not migrate tables or data; use a tool such as Ora2Pg for that. It is not a full Oracle emulator: SQL whose Oracle behavior cannot be reproduced reliably is rejected instead of approximated.

Features

  • JDBC driver: jdbc:orafit: URL and io.github.orafit.jdbc.OrafitDriver, delegating to pgJDBC. Bind parameters, OUT values, JDBC result metadata, update counts, vendor error codes, and transaction state are preserved.
  • SQL rewriting within the verified scope: DUAL, empty-string/NULL semantics, ROWNUM, legacy outer joins (+), LISTAGG, hierarchical queries, MERGE, RETURNING INTO.
  • SQL runtime: a native extension for self-managed PostgreSQL and a plain SQL installer for managed services such as Aurora PostgreSQL.
  • Offline analyzer: included in the JAR; scans SQL files without executing them and summarizes what is rewritten, rejected, or out of scope.

Verified coverage (representative cases):

  • Numeric: MOD, REMAINDER, SQRT, CEIL, TO_NUMBER; NUMBER division precision, rounding and overflow.
  • String: REPLACE, TRANSLATE, TO_CHAR, UPPER, RPAD, LENGTH; CHAR blank-padding comparison; mixed-type NULLIF/COALESCE datatype errors.
  • Date: DATE subtraction, TIMESTAMP to DATE truncation, TO_DATE error precedence, NEXT_DAY, TRUNC/ROUND, EXTRACT.
  • Query: fractional, NULL and negative FETCH counts; NEXTVAL repeated in one row; NEXTVAL in WHERE rejected as ORA-02287.

Scope and limitations

Each area in COMPATIBILITY.md is one of ✅ Supported, ⚠️ Supported subset, ⛔ Rejected, ➖ Out of scope. Not supported in this release: STDDEV precision, FETCH PERCENT, mixed TIMESTAMP/DATE subtraction, BYTE/Unicode/character-set-dependent functions, IGNORE NULLS, MEDIAN, PERCENTILE_CONT, KEEP (DENSE_RANK ...), RAW conversion, NLS-dependent conversion.

Item Target
Java 17 or later
Oracle baseline Oracle Database 18c XE
PostgreSQL 16 supported, 17 primary, 18 compatibility check only; 15 and older not supported
Aurora PostgreSQL 16/17 Supported through the plain SQL installer

Verification

501 differential tests between Oracle 18c XE 18.4.0.0.0 and embedded PostgreSQL 17.10, and 672 Maven tests, all passing. Within the declared scope they compare values, row order, NULLs, errors, binds/OUT values, JDBC metadata, update counts, and post-DML state.

Downloads

Also on Maven Central: io.github.ltslab:orafit-jdbc:1.0.0

Install / Upgrade

  1. Extract the runtime archive. Self-managed PostgreSQL: copy native/ to the extension directory and run CREATE EXTENSION orafit;. Managed PostgreSQL: run psql -v ON_ERROR_STOP=1 -f orafit--1.0.0.sql from plain/.
  2. Add orafit-jdbc-1.0.0.jar and pgJDBC to the classpath.
  3. Set driver=io.github.orafit.jdbc.OrafitDriver and url=jdbc:orafit://<host>:<port>/<database>.

Analyzer: java -jar orafit-jdbc-1.0.0.jar [--details] path/to/sql. License: MIT; the bundled JSqlParser is Apache-2.0 (see THIRD_PARTY_NOTICES.md).

Full Changelog: https://github.com/ltslab/orafit/commits/v1.0.0