oracledb 1.0.0
oracledb: ^1.0.0 copied to clipboard
A pure Dart Oracle Database driver implementing thin-mode TNS/TTC wire protocol. No Oracle Client required.
Changelog #
1.0.0 #
First stable release. Connection pooling — the milestone the 0.9.0 notes named as the 1.0 gate — is complete, and the public API now follows semantic versioning (breaking changes bump the major version). The full driver is validated against Oracle 23ai and Oracle 21c.
Features #
- Connection pooling (
OraclePool):create()builds a pool of prewarmed, authenticated sessions (minConnections/maxConnections);acquire()/release()borrow and recycle sessions, rolling back uncommitted work on release;withConnection()wraps the acquire/release pair leak-safely;acquireTimeoutbounds queued waits when the pool is exhausted;idleTimeoutshrinks surplus idle sessions back towardminConnections;close(drainTimeout: ...)drains borrowed sessions on shutdown; and session tagging (acquire(tag: ...)with an optionalsessionCallback) reuses session state such as NLS settings across borrowers.
Bug Fixes #
- Pooled sessions recover from cross-session DDL transparently: a cached
SELECTcursor whose result shape changed under it (e.g. a column dropped by another session) reportedORA-01007/ORA-00932to the caller on re-execute. The driver now mirrors node-oracledb — for queries, on those two describe-mismatch codes, it clears the dead cursor and re-executes once as a full parse — so the caller sees correct rows instead of a spurious error. Bounded to a single retry; integrity/constraint violations are never retried. - No connection leak when a pool is closed mid-prewarm:
OraclePoolnow rechecks the closed flag after each connection open during prewarm and destroys a connection opened afterclose()rather than parking it into the drained idle set. close(drainTimeout:)waits for in-flight opens: the close drain now accounts for grow-on-demand / waiter-provision connection opens still in flight, so a positivedrainTimeoutresolves only once those have landed and self-disposed rather than while a socket teardown is still pending.
0.9.3 #
Large-object and binary type support, JSON, plus protocol hardening.
Features #
- CLOB: read and write Character Large Objects; inline binding for values up to 32,767 bytes, temp-LOB protocol for larger payloads.
- BLOB: read and write Binary Large Objects with the same inline/temp-LOB routing boundary.
- RAW: read and write
RAWcolumns with comprehensive edge-case coverage. - JSON: native
OracleDbType.jsonbind type; values are encoded/decoded via OSON;JSONcolumn support requires a tablespace with 8k+ block size.
Bug Fixes #
- Malformed TTC streams now fail loudly instead of spinning the receive loop, surfacing protocol corruption as an error rather than a hang.
- TIMESTAMP payloads of lengths other than 7/11/13 bytes are now tolerated, matching node-oracledb decode behavior.
RETURN_PARAMETERkey-value and registration sections are now read unconditionally, fixing edge cases in PL/SQL returning clauses.- OUT-bind
maxSizeis now validated before the network round-trip; oversized values are rejected with a clear error rather than a server-side failure. - Single-round-trip BLOB read guard prevents partial reads from silently truncating large binary results.
- OSON zero-length number now encodes to the same wire representation as node-oracledb (parity fix).
Documentation #
- Add a project reference set (overview, architecture, API reference, development guide) under
docs/. - Document the tablespace requirement for creating JSON columns.
0.9.2 #
Bug Fixes #
- Reverted a false-positive protocol-error guard on multi-batch column-count mismatches: Oracle legitimately sends fewer column bytes than the total column count during multi-batch fetches, and the guard was incorrectly raising
oraProtocolErroron valid server responses. ClientInfostatic finals inauth_message.dartare now guarded with try-catch IIFEs, matching the safe pattern already used infast_auth_message.dart, preventing crashes if the environment is partially unavailable during connection setup.
Documentation #
- Update README platform support to reflect Android and iOS as declared native Dart targets while keeping web explicitly unsupported.
- Keep README dependency examples aligned with the package version.
Tooling #
- Add a README version-sync helper and wire it into CI, publish, and release bumping so future releases fail before publishing if README dependency references drift from
pubspec.yaml.
0.9.1 #
Packaging #
- Android and iOS added to the supported platforms list. The transport layer uses only
dart:ioTCP sockets (Socket,SecureSocket) which are available on both mobile platforms — no code changes were required.
0.9.0 #
First stable-leaning release. The core driver — connections, authentication, queries, DML, transactions, statement caching, and PL/SQL — is validated against Oracle 23ai and Oracle 21c. LOB (CLOB/BLOB), RAW, and JSON type support landed in 0.9.3. 1.0.0 will follow once connection pooling lands.
Features #
- PL/SQL execution: stored procedures and functions with OUT / IN OUT bind parameters via
OracleBind.out/OracleBind.inOut; values returned throughOracleResult.outBinds(by name or position) - TIMESTAMP WITH TIME ZONE support: decoded as a UTC
DateTimeby default, or asOracleTimestampTzpreserving the original offset when connecting withpreserveTimestampTimeZone: true OracleDbType.timestampTzfor PL/SQL OUT / IN OUT binds ofTIMESTAMP WITH TIME ZONEparameters; OUT values follow the connection's decode contract (UTCDateTimeby default,OracleTimestampTzon apreserveTimestampTimeZone: trueconnection)OracleResult.moreRowsAvailable:truewhenever the driver could not fully drain the result set (the result is then a truncated prefix) — either the 1,000-batch fetch safety cap stopped the drain early, or the server reported more rows pending on a cursor the driver had no usable cursor id to keep fetchingOracleTimestampTznow implementsComparable(ordering by the UTC instant, tie-breaking onoffsetMinutes, socompareTo == 0iff==), stores the offset as a singleoffsetMinutes, and adds afromHourMinutefactory (tzHourOffset/tzMinuteOffsetremain available as getters).OracleTimestampTzis new in 0.9.0 and was never published in any earlier release, so theoffsetMinutesconstructor shape is not a breaking change for released users
Bug Fixes #
- SELECT results were silently capped at 50 rows in all previous 0.1.0-alpha releases; full result sets are now fetched (bounded by a 1,000-batch safety cap)
- Re-executing a cached multi-batch SELECT no longer truncates the result to one prefetch window: the server echoes cursor id 0 on a cached-cursor re-execute, and the fetch drain now falls back to the request's own cursor id (
moreRowsToFetchis cleared only by ORA-01403, matching node-oracledb thin semantics) - Duplicate-column bit vectors are now cleared after every decoded row (a stale vector silently sheared all later columns of the next row), and a duplicate marked on the first row of a FETCH round is resolved against the last row of the previous round; a duplicate with no prior row anywhere raises a protocol error on the strict decode pass instead of a misaligned decode (the lenient stream-completion probe instead skips the marker byte-accurately and substitutes null, by design)
- PL/SQL OUT binds of
TIMESTAMP WITH TIME ZONEnow honor the connection'spreserveTimestampTimeZoneflag (previously they always decoded to a UTCDateTime) - A plain
DateTimebound underOracleDbType.timestampTzis now encoded as its UTC instant at an explicit+00:00offset (full 13-byte payload) — the server mishandles an offset-less 11-byte TSTZ bind and echoes invalid zone bytes back, corrupting the round-trip OracleTimestampTz.fromOffsetnow rejects all sub-minute offsets (a sub-second remainder such asmilliseconds: 500previously slipped through)OracleException.codeis total: a negative (invalid) error code renders asORA-invalid(<code>)instead of throwing;toStringdelegates to it unconditionally
Hardening #
- Malformed
TIMESTAMP WITH TIME ZONEwire payloads (zone offset past the +14:00 ceiling, mixed-sign hour/minute bytes, or a short 7/11-byte payload on the TSTZ decode path) raiseOracleException(protocol error) — neverArgumentErroror a silently fabricated+00:00offset - CI: the duplicated Oracle readiness probes for the 23ai and 21c integration jobs are extracted into one parameterized
scripts/ci_wait_for_oracle.sh - Protocol-version gating for pre-23ai servers (12.2 through 23ai TTC field versions) and a hardened classical AUTH_PHASE_ONE/TWO path
- Receive-loop exhaustion caps, transport poisoning on timeout, and fail-loud auth state transitions
- NUMBER/DATE/TIMESTAMP codec guards: NaN/Infinity rejection at bind construction, BCE date rejection, exponent-range checks
- Statement-cache correctness: DDL invalidation, bind-type signatures in the cache key, FOR UPDATE exclusion
- Unit test suite grown to ~818 tests; CI runs integration suites against both Oracle 23ai and Oracle 21c with a coverage floor
Packaging #
pubspec.yamlnow declares supported platforms explicitly: macOS, Windows, Linux (mobile untested, web unsupported)- Minimum Dart SDK raised from 3.3.0 to 3.12.0
0.1.0-alpha.5 #
Improves pub.dev analysis score and repository presentation.
Bug Fixes #
- Use exact canonical Apache 2.0 license text recognized by
panato fix license analysis on pub.dev - Fix CI badge URL in README
0.1.0-alpha.3 #
Fixes a missing permission in the publish workflow that prevented package releases.
Bug Fixes #
- Add
contents: readpermission to the publish GitHub Actions workflow to allow package publishing to succeed
0.1.0-alpha.2 #
Resolves pub.dev publish warnings and improves package scoring by fixing the library name, license, and adding a working example.
Features #
- Add
example/example.dartwith a working usage example, satisfying pub.dev's example requirement (+10 pub points)
Bug Fixes #
- Rename
lib/dart_oracledb.darttolib/oracledb.dartto match the package name convention required by pub.dev - Restore canonical Apache 2.0 license text so pana correctly identifies it as an OSI-approved license (+10 pub points)
- Add
.pubignoreto excludereference/,_bmad/,scripts/, anddocker-compose.ymlfrom the published package - Add
CHANGELOG.mdas required by pub.dev
0.1.0-alpha.1 #
Initial alpha release.
Features #
- TCP connection to Oracle Database via direct TNS/TTC wire protocol — no Oracle Instant Client required
- Authentication: FAST_AUTH single-round-trip (Oracle 23ai) and classical AUTH_PHASE_ONE/AUTH_PHASE_TWO (Oracle 21c and earlier)
OracleConnection.connectandOracleConnection.withConnectionfactory methodsexecute()— SELECT queries and DML (INSERT, UPDATE, DELETE) with named and positional bind parameterscommit(),rollback(),runTransaction()— transaction managementping()— connection health check- Transparent statement cache (configurable size)
- TLS/SSL encrypted connections via
TlsConfig OracleResult/OracleRow— row access by column name (case-insensitive) or index,toMap()helper- ~490 unit tests; integration test suite validated against Oracle 23ai and Oracle 21c
Platforms #
macOS, Windows, Linux, iOS, Android (not web — requires dart:io TCP sockets).