yiisoft/db-oracle
Oracle driver for Yii Database, bringing Oracle support to yiisoft/db. It provides schema introspection, query building, transactions, and ActiveRecord integration so Yii applications can work with Oracle databases through the familiar database abstraction layer.
What this release actually is. The changelog is for yiisoft/db-oracle 2.0.0 — the Oracle driver for the Yii3 database abstraction layer (yiisoft/db). It is not a Laravel package and does not integrate with Eloquent, the query builder, or Illuminate\Database. Any assessment of "fit" for a Laravel codebase has to start from that fact: this is a PDO/OCI8 driver that implements the yiisoft/db contracts (ConnectionInterface, SchemaInterface, QueryBuilderInterface, CommandInterface, ColumnInterface), and it is consumed either inside a Yii3 application or standalone with a small amount of Yii DI/container wiring.
Architecture fit.
yiisoft/db core, so it is effectively mandatory for anyone on the new core.yajra/laravel-oci8 or raw oci8/PDO for that; adopting yiisoft/db-oracle means running two independent DB abstractions side by side.ColumnInterface implementations per DB type, ColumnFactory, ColumnBuilder → ColumnDefinitionBuilder → ColumnDefinitionParser, SqlParser). That is a meaningful investment in correctness of schema introspection and DDL generation, which is historically where Oracle drivers rot.Integration feasibility.
yiisoft/db is framework-agnostic, PHP 8.1+, and can be instantiated directly. The cost is dependency weight (Yii DI, cache, var-dumper, etc.), a second connection/transaction model, and two schema-introspection code paths in one repo.oci8 PHP extension and Oracle Instant Client on every host and in CI images. That is the dominant operational gate, not the package itself.yiisoft/db 2.x. Mixed 1.x/2.x pins across packages in the same vendor tree will not resolve.Technical risk (2.0.0 specific). This is a breaking release with an unusually large blast radius — treat it as a rewrite of the driver's public surface, not an upgrade:
| Change | Risk |
|---|---|
ColumnSchemaInterface renamed to ColumnInterface; old ColumnInterface removed (#296, #298) |
Any custom column/type class must be rewritten |
TableSchema class removed (#348) |
Code touching table metadata directly breaks |
batchInsert() → insertBatch(), parameters reordered to $table, $rows, $columns = [] (#268) |
Silent-behaviour risk if call sites are updated mechanically without re-checking argument order |
insertWithReturningPks() → insertReturningPks() (#330) |
Rename-only, low risk |
dropTable() gains $ifExists, $cascade (#307) |
Interface break for implementors/mocks |
Minimum PHP raised to ^8.1, supported 8.1 – 8.5 (#277, #306) |
Drops PHP 8.0 hosts; validate target runtime and CI matrix |
| "unsigned" column usage now throws (#378) | Runtime exceptions on previously tolerated schemas; must be caught at schema-introspection time |
getCacheKey()/getCacheTag() removed from Schema (#315) |
Any app-level schema caching keyed off these silently loses its cache strategy |
Yiisoft\Db\Exception\InvalidArgumentException → \InvalidArgumentException (#332) |
Catch blocks must be widened |
Expression namespace moves (#365), QueryBuilder constructor change (#294), Dsn refactor (#283, #344) |
Wiring/config code needs revisiting |
Quoter now owns getRawTableName() (#272) |
Call sites referencing schema for raw names break |
Net: high upgrade cost, low steady-state risk. The feature additions (JSON type support #303, enumeration columns #382, boolean #319, collation #352, caseSensitive LIKE option #311, typed DateTimeColumn #323, ArrayMergeBuilder/LongestBuilder/ShortestBuilder #357) are genuinely useful for Oracle shops, but they are not free — they land together with the breaking renames.
Key questions for the vendor/owning team.
yiisoft/db-oracle 2.0.0 pinned to a specific yiisoft/db minor, and is the compatibility range documented? (#336's yiisoft/db-implementation virtual package suggests provider-style resolution — confirm how it behaves with Composer 2.)@Tigrov authors the large majority of changes), or commercially backed? Bus-factor is the single biggest concern with this dependency.Stack fit.
yiisoft/db moves to 2.x. Plan it as a scheduled migration, not an opportunistic bump.yiisoft/db-oracle connection, exposes typed repository methods, and never leaks Yii types into controllers/jobs. Eloquent remains the system of record for the app database; Oracle access is explicit and contained.yajra/laravel-oci8 or Doctrine DBAL's Oracle platform first; they carry far less ecosystem coupling for a Laravel shop.Migration path (1.x → 2.0.0). Sequence matters more than speed:
yiisoft/db to the matching 2.x line, then the driver, in the same PR. Do not stagger.ColumnSchemaInterface→ColumnInterface, insertWithReturningPks→insertReturningPks, batchInsert→insertBatch (with explicit argument-order review at every call site), exception class replacement.TableSchema usage, move raw-table-name lookups to QuoterInterface, rebuild custom columns against the new ColumnInterface/ColumnFactory, re-establish schema caching without getCacheKey/getCacheTag.dropTable call sites now that $ifExists/$cascade exist (good opportunity to make teardown in test fixtures idempotent).caseSensitive LIKE. These are net-new behaviour and should not be bundled into the compatibility upgrade.Compatibility checks before any code moves.
8.1, ceiling 8.5 — verify CI images, Docker base images, and any shared hosting constraints.oci8 + Oracle Instant Client version alignment on dev, CI, staging, prod.yiisoft/* set; expect a coordinated lockfile bump.Sequencing recommendation. Treat 2.0.0 adoption as its own workstream with a two-week spike: (a) stand up the driver against a schema-copy Oracle instance, (b) run the introspection baseline suite from step 1, (c) produce a call-site inventory of the renamed/removed APIs. Decide go/no-go on the spike output, not on the changelog.
Maintenance.
~2.0.0 initially, widen only after the package has had a few patch releases and the ecosystem settles.Support.
oci8 queries, or Doctrine DBAL) if a critical Oracle incompatibility appears and is not patched promptly.yiisoft/db coupling means a bug in the core can block the driver; you inherit the core's support characteristics too.Scaling.
ColumnInterface classes remove per-row type-checking overhead (#236, #349, #275), the SqlParser (#255, #321) reduces regex-based introspection cost on large schemas, prepareBinary() override (#292) helps LOB handling, and insertBatch with Traversable support (#260) enables streaming bulk loads.Failure modes to instrument.
unsigned exception at runtime (#378) — can surface as a hard failure on an otherwise-working schema. Fail fast at deploy, not at request time.insertBatch signature change — no type error if call sites pass $table, $columns, $rows as before; watch for garbled bulk inserts in staging.getCacheKey/getCacheTag removal — manifests as latency creep, not errors; monitor introspection call counts.Ramp-up.
ColumnInterface/ColumnFactory rewrite plus the ColumnDefinitionBuilder/Parser model.How can I help you explore Laravel packages today?