Skip to content

v0.10.0

Latest

Choose a tag to compare

@buggins buggins released this 03 Nov 15:17
· 2 commits to master since this release
76ca59a

One new feature since 0.9.0: a native Oracle driver.

Native Oracle driver (#163, #164)

A new configuration ORACLE ("subConfigurations": { "ddbc": "ORACLE" }) adds a driver built on oracle-native 0.1. It speaks Oracle Net (TNS/TTC) in pure D, with no Instant Client, OCI, ODBC driver or other C library at build time. TLS is available, with OpenSSL loaded at run time. Oracle Database 12.1 and newer.

ddbc:oracle://127.0.0.1:1521/FREEPDB1?user=scott,password=tiger
  • URLs: oracle:// URLs use it when it is compiled in, and ODBC otherwise, so full builds behave as before. The path is the service name (sid=... connects by SID). Other parameters are oracle-native's connection options (secure, tls_ca_file, fetch_size, statement_cache_size, time_zone, ...); ODBC-style names (username, uid, pwd, driver) are accepted.
  • Types: all getters and setters. NUMBER is exact through getDecimal, keeping the column's scale; BINARY_FLOAT/BINARY_DOUBLE, VARCHAR2/NVARCHAR2/CHAR, RAW, DATE and TIMESTAMP (as UTC through getSysTime), TIMESTAMP WITH TIME ZONE with its zone, CLOB/NCLOB/BLOB through getString/getBytes, LONG, ROWID. Empty strings are NULL in Oracle.
  • Statements:
    • prepared statements take ? (or :1, :name) placeholders and are parsed once, through oracle-native's statement cache;
    • executeUpdate(sql, insertId) gives the value of a RETURNING id INTO ? clause, whose placeholder needs no value (Oracle has no "last insert id"); ddbc.pods appends that clause for the PL/SQL dialect;
    • auto-commit (on by default, auto_commit=false in the URL) commits after each statement that changes data; the isolation levels are READ_COMMITTED and SERIALIZABLE; the catalog is the current schema.
  • Result sets are forward-only and streamed, with metadata (precision, scale, character lengths).
  • getNativeConnection() gives the oracle-native connection, e.g. for LOB locators, array DML, PL/SQL OUT parameters and REF cursors.
  • Works in thread mode and vibe.d fiber mode. Tested against Oracle 23ai Free in CI, and 21c XE and 18c XE locally.

Compatibility

  • dbwire:types is now ~>0.5.0 (was ~>0.4.0) for every configuration, and the MSSQL configuration needs mssql-native ~>0.2.1: dub resolves the dependencies of all configurations together, and oracle-native requires dbwire 0.5. Projects that pin dbwire 0.4 must move to 0.5 (no API changes; 0.5 only adds dbwire:crypto).
  • No API changes. Minimum D frontend unchanged: 2.097 (DMD 2.097, LDC 1.27).

Full changelog: v0.9.0...v0.10.0