summaryrefslogtreecommitdiff
path: root/django/db/backends
diff options
context:
space:
mode:
authorSimon Charette <charette.s@gmail.com>2025-01-27 15:11:19 -0500
committerSarah Boyce <42296566+sarahboyce@users.noreply.github.com>2025-02-11 09:15:58 +0100
commitf8fce8d4dce7cf6d272a29351faddd5fa76f1aa0 (patch)
treecd039d4f02d8bcdec6d78d6831239eb48a67a406 /django/db/backends
parent16c7dc543c3a0e8a4c7554e36dd6166d5c12c872 (diff)
[5.2.x] Refs #36148 -- Relied on a feature switch to define tuple lookups support.
This should allow backends more easily opt-in or out of native support and rely on the fallback if unavailable. Backport of a0a765ddeb5056c85e084773d3f6432e2a426638 from main.
Diffstat (limited to 'django/db/backends')
-rw-r--r--django/db/backends/base/features.py3
-rw-r--r--django/db/backends/oracle/features.py1
-rw-r--r--django/db/backends/sqlite3/features.py1
3 files changed, 5 insertions, 0 deletions
diff --git a/django/db/backends/base/features.py b/django/db/backends/base/features.py
index 53b48673de..0f8e6f41a6 100644
--- a/django/db/backends/base/features.py
+++ b/django/db/backends/base/features.py
@@ -368,6 +368,9 @@ class BaseDatabaseFeatures:
# Does the backend support unlimited character columns?
supports_unlimited_charfield = False
+ # Does the backend support native tuple lookups (=, >, <, IN)?
+ supports_tuple_lookups = True
+
# Collation names for use by the Django test suite.
test_collations = {
"ci": None, # Case-insensitive.
diff --git a/django/db/backends/oracle/features.py b/django/db/backends/oracle/features.py
index ad9ab8da55..7ebe69c6dd 100644
--- a/django/db/backends/oracle/features.py
+++ b/django/db/backends/oracle/features.py
@@ -81,6 +81,7 @@ class DatabaseFeatures(BaseDatabaseFeatures):
allows_multiple_constraints_on_same_fields = False
supports_json_field_contains = False
supports_collation_on_textfield = False
+ supports_tuple_lookups = False
test_now_utc_template = "CURRENT_TIMESTAMP AT TIME ZONE 'UTC'"
django_test_expected_failures = {
# A bug in Django/oracledb with respect to string handling (#23843).
diff --git a/django/db/backends/sqlite3/features.py b/django/db/backends/sqlite3/features.py
index 60893561df..6ab6308ece 100644
--- a/django/db/backends/sqlite3/features.py
+++ b/django/db/backends/sqlite3/features.py
@@ -61,6 +61,7 @@ class DatabaseFeatures(BaseDatabaseFeatures):
insert_test_table_with_defaults = 'INSERT INTO {} ("null") VALUES (1)'
supports_default_keyword_in_insert = False
supports_unlimited_charfield = True
+ supports_tuple_lookups = False
@cached_property
def django_test_skips(self):