Skip to content

oracle-native 0.1.0

Choose a tag to compare

@buggins buggins released this 03 Nov 14:15
· 38 commits to main since this release
2e0eaab

The first release of oracle-native, a native Oracle Database client for D: the Oracle Net (TNS) and TTC protocols in pure D, for threads (blocking sockets) and vibe.d fibers, with no Oracle Instant Client, no OCI, no ODBC and no C libraries at build time.

"dependencies": {
    "oracle-native": "~>0.1.0"
}

Tested on Oracle Database 23ai Free, 21c XE and 18c XE (12.1 and newer on the wire); D frontend 2.097 and newer; vibe-core 1.22 to 2.x. Built on dbwire 0.5.

Unofficial project, not affiliated with Oracle. Oracle is a registered trademark of Oracle and/or its affiliates.

Added

  • High-level API (#6): ConnectionPool / PooledConnection for threads and
    vibe.d fibers (dbwire's pool core; pool_* connection string parameters;
    uncommitted changes rolled back when a connection is handed out again),
    struct mapping (query!T, queryRow!T, queryValue!T, insert with
    array DML; @column, @ignore), fiber-mode tests against vibe-core 1.x
    and 2.x, examples (:example-basic, :example-vibe).
  • LOBs and long data (#5): CLOB, NCLOB and BLOB columns fetched with their
    contents (as LONG / LONG RAW) or, with the lob_locators option, as
    locators; Lob (length, read and readText at offsets, write and
    writeText, trim, free), Value.getLob, getLobSize; temporary LOBs
    (Connection.createLob) bound as parameters; BFILE reads; strings and
    bytes of any length bound (values over 32767 bytes are sent after the
    others, as LONG binds require).
  • Bind variables and statements (#4): :1, :name and ? placeholders,
    Parameter (D values to Oracle types, NULLs, named binds, Variant),
    OUT and IN OUT parameters (Parameter.output, inOut, refCursor),
    RETURNING ... INTO (one value per changed row), QueryResult.outputs,
    rowCount and implicitResults, REF cursors; array DML (execMany) with
    row counts per row and batch errors; a statement cache per connection
    (re-execution with new values, re-parse when a table changed; option
    statement_cache_size); Connection.cancel.
  • Data types (#3): BINARY_FLOAT/BINARY_DOUBLE, DATE, TIMESTAMP (with
    nanoseconds), WITH TIME ZONE (offsets and regions, with a region table
    generated from the server by tools/tzregions.d), WITH LOCAL TIME ZONE
    (converted from the database to the session time zone), INTERVAL YEAR TO MONTH, INTERVAL DAY TO SECOND, LONG, LONG RAW, UROWID; NUMBER as an
    exact Decimal. New Value type and getters (getInt, getBool,
    getDecimal, getDate, getTime, getDateTime, getSysTime,
    getNanoseconds, getDuration, getMonthInterval, getVariant); the
    texts of dates, timestamps and intervals are those of the server.
  • Connecting and first statements (#2):
    • the listener handshake (TNS 318: CONNECT, ACCEPT, REFUSE, REDIRECT,
      RESEND, SDU up to 2 MB), protocol and data-type negotiation, Native Network
      Encryption declined (servers requiring it are refused with a clear error);
    • O5LOGON password logins with 11g and 12c verifiers, the server's proof
      checked, session information (serverVersion, sessionId,
      serialNumber, serviceName, databaseName, maxIdentifierLength);
    • TLS (TCPS) through dbwire with certificate and host name verification;
    • oracle:// URLs, Easy Connect ([tcps://]host[:port]/service[:server][/instance])
      and connect descriptors (address lists, LOAD_BALANCE, SID,
      INSTANCE_NAME, SERVER); failover to the next address; client
      identification and session time zone options;
    • exec (row counts), query (rows fetched in batches, duplicate-column
      compression), commit, rollback, ping, close (logoff), an
      autoCommit option, server errors with ORA code and position, cursors
      closed with the next call;
    • NUMBER (text, long, double), VARCHAR2/CHAR/NVARCHAR2/NCHAR
      text, RAW (hex), ROWID;
    • integration tests on 23ai, 21c and 18c in thread and fiber mode, TLS
      through a test proxy.
  • Repository scaffold (#1): dub package oracle-native (module oracle) on
    dbwire 0.5, CI on Linux, Windows and macOS with DMD and LDC down to frontend
    2.097, Oracle Database Free 23ai and XE 21c service containers for
    integration tests, lint and documentation checks.