Refs #26608 -- Added a database feature for fixed frame range distance support.
This commit is contained in:
parent
64d5bafbc6
commit
b8c48d06fa
|
@ -239,6 +239,7 @@ class BaseDatabaseFeatures:
|
|||
|
||||
# Does the backend support window expressions (expression OVER (...))?
|
||||
supports_over_clause = False
|
||||
supports_frame_range_fixed_distance = False
|
||||
|
||||
# Does the backend support CAST with precision?
|
||||
supports_cast_with_precision = True
|
||||
|
|
|
@ -52,6 +52,7 @@ class DatabaseFeatures(BaseDatabaseFeatures):
|
|||
"""
|
||||
supports_callproc_kwargs = True
|
||||
supports_over_clause = True
|
||||
supports_frame_range_fixed_distance = True
|
||||
supports_ignore_conflicts = False
|
||||
max_query_params = 2**16 - 1
|
||||
supports_partial_indexes = False
|
||||
|
|
|
@ -536,8 +536,7 @@ class WindowFunctionTests(TestCase):
|
|||
('Brown', 53000, 'Sales', datetime.date(2009, 9, 1), 108000),
|
||||
], transform=lambda row: (row.name, row.salary, row.department, row.hire_date, row.sum))
|
||||
|
||||
@skipIf(connection.vendor == 'postgresql', 'n following/preceding not supported by PostgreSQL')
|
||||
@skipIf(connection.vendor == 'sqlite', 'n following/preceding not supported by SQLite')
|
||||
@skipUnlessDBFeature('supports_frame_range_fixed_distance')
|
||||
def test_range_n_preceding_and_following(self):
|
||||
qs = Employee.objects.annotate(sum=Window(
|
||||
expression=Sum('salary'),
|
||||
|
|
Loading…
Reference in New Issue