Repository navigation
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, sofullbuilds 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.
NUMBERis exact throughgetDecimal, keeping the column's scale;BINARY_FLOAT/BINARY_DOUBLE,VARCHAR2/NVARCHAR2/CHAR,RAW,DATEandTIMESTAMP(as UTC throughgetSysTime),TIMESTAMP WITH TIME ZONEwith its zone,CLOB/NCLOB/BLOBthroughgetString/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 aRETURNING id INTO ?clause, whose placeholder needs no value (Oracle has no "last insert id");ddbc.podsappends that clause for the PL/SQL dialect;- auto-commit (on by default,
auto_commit=falsein the URL) commits after each statement that changes data; the isolation levels areREAD_COMMITTEDandSERIALIZABLE; the catalog is the current schema.
- prepared statements take
- 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:typesis now~>0.5.0(was~>0.4.0) for every configuration, and theMSSQLconfiguration 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 addsdbwire:crypto).- No API changes. Minimum D frontend unchanged: 2.097 (DMD 2.097, LDC 1.27).
Full changelog: v0.9.0...v0.10.0