feat(oracledb): finalize advanced surfaces and add native event backends#564
Merged
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #564 +/- ##
==========================================
+ Coverage 75.40% 75.68% +0.27%
==========================================
Files 449 449
Lines 59979 59986 +7
Branches 9144 9144
==========================================
+ Hits 45226 45398 +172
+ Misses 11836 11657 -179
- Partials 2917 2931 +14
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
The advanced_queue backend targeted the legacy cx_Oracle AQ API and never worked against python-oracledb 4.x. Un-skipping the integration tests (by granting AQ privileges to the container app user and removing the blanket skip-on-any-exception) exposed three breaks, now fixed: - connection.queue() payload type is the string "JSON", not DB_TYPE_JSON - enqueue builds connection.msgproperties(payload=...) and enqone(message) - dequeue configures queue.deqoptions in place and calls deqone() with no args Classic-AQ JSON now round-trips in thin mode on Oracle 23ai.
Adds a distinct transactional_event_queue events backend that shares the verified classic-AQ client path (queue/enqueue/dequeue) via subclassing, so the two backends cannot silently diverge. Only the backend label and the provisioning DDL (DBMS_AQADM.CREATE_TRANSACTIONAL_EVENT_QUEUE) differ. - OracleEventsBackend literal + docstring gain "transactional_event_queue" - OracleSync/AsyncTxEventQEventBackend subclass the AQ backends - create_event_backend factory handles the new literal (sync + async) - AQ hub takes a backend_name for correct observability labels
…nd-trip Also makes the backend mode-gate errors class-aware (type(self).__name__) so the TxEventQ backends report their own name instead of the AQ base class name.
…vent_queue backends
Type the events extension_config dict as dict[str, Any] so the **kwargs spread is not coerced into the EventsConfig TypedDict, and annotate the deliberately-mistyped config in the mode-gate guard tests.
2567e54 to
d3b16b7
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Finalizes the Oracle advanced-surface work and adds native Oracle event-channel backends.
Advanced surfaces
StatementConfig.execution_args.Native event backends (Advanced Queuing + Transactional Event Queues)
advanced_queuebackend. The classic AQ events backend had never been exercised against a live queue — its integration tests silently skipped because the test user was never granted AQ privileges — and it was broken against python-oracledb 4.x. It is now ported to the 4.x AQ API:connection.queue(name, "JSON")for the handle,connection.msgproperties(payload=...)+queue.enqone(message)to enqueue, and in-placequeue.deqoptions+queue.deqone()to dequeue.transactional_event_queuebackend. A new native backend for Oracle Transactional Event Queues, provisioned withDBMS_AQADM.CREATE_TRANSACTIONAL_EVENT_QUEUE. It shares the classic-AQ client path (subclasses it), so the two backends can't diverge — only the backend label and the provisioning DDL differ.table_queueremains the default backend.DBMS_AQADMprivileges, provisioning, and per-channel-queue isolation via the{channel}queue-name template.Testing
listendelivery, metadata preservation, and concurrent multi-channel isolation, across both native backends.make lintandmake type-check(mypy + pyright + slotscheck) clean on the changed scope.Known follow-up
table_queuebackend's integration test connects via a hardcoded DSN instead of the shared container fixture, so it still skips even when the container is running. Tracked separately; not addressed here.