Skip to content

oracle-native 0.3.0

Choose a tag to compare

@buggins buggins released this 07 Nov 17:27
· 20 commits to main since this release
a387407

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 written proxy[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.ora connect aliases (#22): ConnectionOptions.parse (and so
    new Connection(alias, user, password) and pools) resolves a name such as
    SALES through tnsnames.ora in config_dir (new option configDir),
    $TNS_ADMIN or $ORACLE_HOME/network/admin, with several names per
    entry, comments and IFILE includes; parameters may follow the alias
    (SALES?config_dir=/etc/oracle).
  • Wallets and server certificate subjects (#22): walletLocation
    (wallet_location, MY_WALLET_DIRECTORY in descriptors) reads an Oracle
    wallet in PEM form (ewallet.pem): its certificates are the trusted CAs,
    and its private key (password walletPassword / 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=off checks
    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 same PipelineResults (row counts, OUT
    values, all rows of queries, errors with run(true)). The client now
    offers TNS 319 and uses END_OF_RESPONSE when the server offers it.
  • DRCP, Database Resident Connection Pooling (#23): serverType pooled
    (:pooled, server=pooled, (SERVER=POOLED)) with a connection class
    (connectionClass, pool_connection_class, POOL_CONNECTION_CLASS) and
    purity (purity, pool_purity, POOL_PURITY). A ConnectionPool hands
    the session back to the database's pool when a connection is returned
    (Connection.releaseSession), with a connection class of its own and
    purity self; closing a DRCP connection ends its session without a logoff.
  • JSON parameters (#24): std.json.JSONValue values 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/SQL JSON parameters (IN, OUT, IN OUT) and RETURNING ... 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. Variant parameters take JSONValue too.
  • INTERVAL YEAR TO MONTH values inside JSON are decoded (P1Y2M).

Fixed

  • The session-return server piggyback was read with the wrong layout (it
    comes with DRCP). Connection.sessionId and serialNumber follow 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_FLOAT and BINARY_DOUBLE values inside JSON read as
    JSON_SERIALIZE writes 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