Repository navigation
Releases
oracle-native 0.3.1
oracle-native 0.3.1 moves to dbwire 0.8, so it can be used together with postgresql-native 0.5 and clickhoused 0.9 (and in ddbc, which resolves all its configurations together). No code changes.
"dependencies": {
"oracle-native": "~>0.3.1"
}Tested on Oracle Database 23ai Free, 21c XE and 18c XE; D frontend 2.097 and newer; vibe-core 1.22 to 2.x. A ddbc driver for oracle-native is in ddbc 0.10.0 (configuration ORACLE).
Changed
- dbwire 0.8 (
~>0.8.0, #38), the same as postgresql-native 0.5 and
clickhoused 0.9, so they can be used in one build (and in ddbc). With it,
TIMESTAMP WITH TIME ZONEvalues with a region name follow the tz
database's TZif files (buggins/dbwire#33): the local mean time before a
zone's first transition and daylight saving time after 2037.
Full changelog: v0.3.0...v0.3.1
🤖 Generated with Claude Code
oracle-native 0.3.0
oracle-native 0.3.0 adds proxy authentication, tnsnames.ora aliases, wallets with mutual TLS and SSL_SERVER_CERT_DN checks, pipelining, DRCP and JSON binds encoded as OSON.
"dependencies": {
"oracle-native": "~>0.3.0"
}Tested on Oracle Database 23ai Free, 21c XE and 18c XE; D frontend 2.097 and newer; vibe-core 1.22 to 2.x. A ddbc driver for oracle-native is in ddbc 0.10.0 (configuration ORACLE).
Added
- Proxy authentication (#21):
ConnectionOptions.proxyClient(parameter
proxy_client), or the user name writtenproxy[target]: the proxy user
logs in with its own password to a session of the target user, who must
allow it (ALTER USER target GRANT CONNECT THROUGH proxy). tnsnames.oraconnect aliases (#22):ConnectionOptions.parse(and so
new Connection(alias, user, password)and pools) resolves a name such as
SALESthroughtnsnames.orainconfig_dir(new optionconfigDir),
$TNS_ADMINor$ORACLE_HOME/network/admin, with several names per
entry, comments andIFILEincludes; parameters may follow the alias
(SALES?config_dir=/etc/oracle).- Wallets and server certificate subjects (#22):
walletLocation
(wallet_location,MY_WALLET_DIRECTORYin descriptors) reads an Oracle
wallet in PEM form (ewallet.pem): its certificates are the trusted CAs,
and its private key (passwordwalletPassword/wallet_password) and
certificate are used for mutual TLS.serverCertDn(ssl_server_cert_dn,
SSL_SERVER_CERT_DN) checks the server certificate's subject instead of
the host name;ssl_server_dn_match=off/SSL_SERVER_DN_MATCH=offchecks
only the certificate chain. Needs dbwire 0.6. - Pipelines (#20):
conn.pipeline().exec(...).query(...).commit().run()
sends the statements together and reads their responses afterwards on 23ai
(one round trip;Connection.supportsPipelining), and runs them one by
one on older servers, with the samePipelineResults (row counts, OUT
values, all rows of queries, errors withrun(true)). The client now
offers TNS 319 and uses END_OF_RESPONSE when the server offers it. - DRCP, Database Resident Connection Pooling (#23):
serverTypepooled
(:pooled,server=pooled,(SERVER=POOLED)) with a connection class
(connectionClass,pool_connection_class,POOL_CONNECTION_CLASS) and
purity (purity,pool_purity,POOL_PURITY). AConnectionPoolhands
the session back to the database's pool when a connection is returned
(Connection.releaseSession), with a connection class of its own and
purityself; closing a DRCP connection ends its session without a logoff. - JSON parameters (#24):
std.json.JSONValuevalues and JSON text
(Parameter.json) are sent as JSON, encoded by the client in Oracle's
binary format (OSON), so the server doesn't parse text: for JSON columns,
PL/SQLJSONparameters (IN, OUT, IN OUT) andRETURNING ... INTO
(Parameter.output!JSONValue). Numbers in JSON text are kept exactly
(rounded to NUMBER's precision, or BINARY_DOUBLE outside its range, as the
server's parser does); field names longer than 255 bytes need 23ai. Servers
before 21c get the text.Variantparameters takeJSONValuetoo. INTERVAL YEAR TO MONTHvalues inside JSON are decoded (P1Y2M).
Fixed
- The session-return server piggyback was read with the wrong layout (it
comes with DRCP).Connection.sessionIdandserialNumberfollow the
session the server attaches. - A statement parsed again while its SQL was cached and in use (an open
result of the same SQL) kept its cursor open on the server after its result
was done; it is closed now. - Running a PL/SQL block with OUT parameters a second time on a connection
(a re-execution of its cached cursor) failed with ORA-03146 and the server
closed the connection: the client sent values for the OUT parameters and
didn't know their directions without the server's IO vector. BINARY_FLOATandBINARY_DOUBLEvalues inside JSON read as
JSON_SERIALIZEwrites them (0.00001,100,1E+300), not as
1e-05,1e+02,1e+300.
Full changelog: v0.2.0...v0.3.0
🤖 Generated with Claude Code
oracle-native 0.2.0
oracle-native 0.2.0 speaks the 23.4 version of Oracle's TTC protocol and reads and writes the newer types: JSON (21c), VECTOR and BOOLEAN (23ai). It also sets end-to-end attributes for monitoring.
"dependencies": {
"oracle-native": "~>0.2.0"
}Tested on Oracle Database 23ai Free, 21c XE and 18c XE; D frontend 2.097 and newer; vibe-core 1.22 to 2.x. A ddbc driver for oracle-native is in ddbc 0.10.0 (configuration ORACLE).
Added
- Newer types and the 23.4 protocol (#7): the client now speaks TTC field
version 24 (23.4; 21c negotiates 16, 18c 11).JSONcolumns (21c) are
decoded from Oracle's binary JSON (OSON) to their text, as
JSON_SERIALIZEwrites it, andValue.getJsongives astd.jsonvalue.
VECTORcolumns (23ai) read asVector(FLOAT32, FLOAT64, INT8, BINARY,
sparse;getVector, text asFROM_VECTORwrites it), andVector,
float[]anddouble[]parameters are sent as VECTOR.BOOLEANcolumns
arrive natively, andboolparameters are sent asBOOLEANto 23ai
(NUMBER1/0 to older servers), also for PL/SQLBOOLEANparameters. - Column metadata of 23ai: SQL domain, annotations, VECTOR dimensions and
format;isJson/isOsonflags (ColumnInfo). - End-to-end attributes:
Connection.moduleName,action,
clientIdentifier,clientInfo,dbOp, sent with the next call.
Fixed
- Queries with a
JSONcolumn failed with ORA-01002.
Full changelog: v0.1.0...v0.2.0
oracle-native 0.1.0
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/PooledConnectionfor 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,insertwith
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 thelob_locatorsoption, 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,:nameand?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,
rowCountandimplicitResults, 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 bytools/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;NUMBERas an
exactDecimal. NewValuetype 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
autoCommitoption, 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.
- the listener handshake (TNS 318: CONNECT, ACCEPT, REFUSE, REDIRECT,
- Repository scaffold (#1): dub package
oracle-native(moduleoracle) 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.