You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Active Record's AbstractAdapter declares many supports_*? capability flags that adapters override to advertise feature support. Recently merged PRs (#2715, #2717, #2724, #2727; the in-flight #2726) showed a recurring pattern: the underlying Oracle feature was already implemented in oracle-enhanced for years, but the capability flag stayed at the AbstractAdapter default (false). The flag mismatch caused Rails core to take alternative paths or AR-level tests to skip Oracle paths needlessly.
For #2727 (supports_expression_index?), the entire library change was three lines:
defsupports_expression_index?trueend
The dumper, the visitor, and the structure_dump path were all already wired correctly. The flag had simply not been updated to match.
Proposal
Do a systematic audit of every supports_*? method on ActiveRecord::ConnectionAdapters::AbstractAdapter (and at least the PG/MySQL overrides for comparison), and for each:
Classify Oracle's actual support: supported / unsupported / partial.
Compare against current oracle-enhanced override state.
File targeted PRs for any flag where Oracle does support the feature but oracle-enhanced reports false (or vice-versa).
After a survey of recent PRs there's a clear pattern of "the work was done years ago, the flag never caught up". A focused audit pass closes that gap and lets multi-DB Rails apps that target Oracle as a secondary backend get fewer if connection.adapter_name == 'OracleEnhanced' escape hatches.
Surfaced during the survey for #2702 / #2710; the audit is a sibling to issues #2711 (closed by #2726/#2727), #2712 (closed: stays false), #2713 (stored generated columns), #2714 (closed: prepared cache).
Background
Active Record's
AbstractAdapterdeclares manysupports_*?capability flags that adapters override to advertise feature support. Recently merged PRs (#2715, #2717, #2724, #2727; the in-flight #2726) showed a recurring pattern: the underlying Oracle feature was already implemented in oracle-enhanced for years, but the capability flag stayed at the AbstractAdapter default (false). The flag mismatch caused Rails core to take alternative paths or AR-level tests to skip Oracle paths needlessly.For #2727 (
supports_expression_index?), the entire library change was three lines:The dumper, the visitor, and the structure_dump path were all already wired correctly. The flag had simply not been updated to match.
Proposal
Do a systematic audit of every
supports_*?method onActiveRecord::ConnectionAdapters::AbstractAdapter(and at least the PG/MySQL overrides for comparison), and for each:false(or vice-versa).Known state (post-recent PRs)
Already overridden to
true:supports_advisory_locks?(existing)supports_check_constraints?— Wire up CHECK constraint DSL: add_check_constraint, t.check_constraint, dump round-trip #2717supports_common_table_expressions?(existing)supports_deferrable_constraints?(existing)supports_expression_index?— Override supports_expression_index? to true #2727supports_index_sort_order?— Override supports_index_sort_order? to true #2726 (in-flight)supports_insert_returning?— Align supports_insert_returning? with the adapter's actual RETURNING usage #2715supports_optimizer_hints?(existing)supports_unique_constraints?(existing, Add unique constraint DSL matching PostgreSQL adapter #2701)supports_validate_constraints?— Wire up validate_constraint / validate_check_constraint with NOVALIDATE support #2724supports_views?(existing)supports_virtual_columns?(existing)Intentionally
false:supports_partial_index?— Oracle has no true partial index; function-based workaround is a different concept (Investigate supports_partial_index? for Oracle #2712 closed).Candidate flags to audit
Some that are likely already supported but possibly not flipped:
supports_bulk_alter?— Oracle supports multiple operations in one ALTER TABLEsupports_comments?/supports_comments_in_create?—COMMENT ON TABLE/COMMENT ON COLUMNworksupports_datetime_with_precision?— TIMESTAMP(n) supportedsupports_disable_referential_integrity?—ALTER TABLE DISABLE CONSTRAINTexistssupports_explain?— Oracle hasEXPLAIN PLANsupports_foreign_keys?— obviouslysupports_indexes_in_create?— Oracle's CREATE TABLE accepts inline UNIQUE constraints (and the constraint-creates-index pattern); needs a closer looksupports_insert_conflict_target?/supports_insert_on_duplicate_skip?/supports_insert_on_duplicate_update?— Oracle'sMERGEandINSERT ... ON CONFLICT-equivalentssupports_json?— Oracle has JSON column type (12c+)supports_lazy_transactions?— needs verificationsupports_materialized_views?—CREATE MATERIALIZED VIEWexistssupports_savepoints?—SAVEPOINTworkssupports_set_constraints?—SET CONSTRAINTS DEFERREDworkssupports_transaction_isolation?—SET TRANSACTION ISOLATION LEVELexistssupports_transactional_indexes?— needs verificationsupports_table_comments?— see comments aboveLikely PG-only (should stay
falseon Oracle):supports_extensions?— PG-specificsupports_foreign_tables?— PG-specific (FDW)supports_index_include?— PG-specific (INCLUDE (col)syntax)supports_nulls_not_distinct?— PG 15+ specificsupports_partitioned_tables?— Oracle has partitioning but the AR flag may target PG semantics specificallysupports_string_aggregation?— needs check; Oracle has LISTAGGApproach
falseand consider documenting whyWhy now
After a survey of recent PRs there's a clear pattern of "the work was done years ago, the flag never caught up". A focused audit pass closes that gap and lets multi-DB Rails apps that target Oracle as a secondary backend get fewer
if connection.adapter_name == 'OracleEnhanced'escape hatches.Surfaced during the survey for #2702 / #2710; the audit is a sibling to issues #2711 (closed by #2726/#2727), #2712 (closed: stays false), #2713 (stored generated columns), #2714 (closed: prepared cache).