mirror of
https://github.com/django/django.git
synced 2025-05-21 14:26:29 +00:00
Supported native aggregation over INTERVALs on Oracle 23c.
https://docs.oracle.com/en/database/oracle/oracle-database/23/nfcoa/application-development.html#GUID-CE5F8EED-934D-458D-B81C-6C8D617F31A2
This commit is contained in:
parent
39a00f39c5
commit
a816efe238
@ -179,3 +179,7 @@ class DatabaseFeatures(BaseDatabaseFeatures):
|
|||||||
@cached_property
|
@cached_property
|
||||||
def supports_boolean_expr_in_select_clause(self):
|
def supports_boolean_expr_in_select_clause(self):
|
||||||
return self.connection.oracle_version >= (23,)
|
return self.connection.oracle_version >= (23,)
|
||||||
|
|
||||||
|
@cached_property
|
||||||
|
def supports_aggregation_over_interval_types(self):
|
||||||
|
return self.connection.oracle_version >= (23,)
|
||||||
|
@ -31,7 +31,10 @@ class FixDurationInputMixin:
|
|||||||
return sql, params
|
return sql, params
|
||||||
|
|
||||||
def as_oracle(self, compiler, connection, **extra_context):
|
def as_oracle(self, compiler, connection, **extra_context):
|
||||||
if self.output_field.get_internal_type() == "DurationField":
|
if (
|
||||||
|
self.output_field.get_internal_type() == "DurationField"
|
||||||
|
and not connection.features.supports_aggregation_over_interval_types
|
||||||
|
):
|
||||||
expression = self.get_source_expressions()[0]
|
expression = self.get_source_expressions()[0]
|
||||||
options = self._get_repr_options()
|
options = self._get_repr_options()
|
||||||
from django.db.backends.oracle.functions import (
|
from django.db.backends.oracle.functions import (
|
||||||
|
Loading…
x
Reference in New Issue
Block a user