-
Notifications
You must be signed in to change notification settings - Fork 106
/
features.py
79 lines (69 loc) · 2.72 KB
/
features.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
# Copyright (c) Microsoft Corporation.
# Licensed under the BSD license.
from django.db.backends.base.features import BaseDatabaseFeatures
from django.utils.functional import cached_property
class DatabaseFeatures(BaseDatabaseFeatures):
allow_sliced_subqueries_with_in = False
can_introspect_autofield = True
can_introspect_json_field = False
can_introspect_small_integer_field = True
can_return_columns_from_insert = True
can_return_id_from_insert = True
can_use_chunked_reads = False
for_update_after_from = True
greatest_least_ignores_nulls = True
has_json_object_function = False
has_json_operators = False
has_native_json_field = False
has_native_uuid_field = False
has_real_datatype = True
has_select_for_update = True
has_select_for_update_nowait = True
has_select_for_update_skip_locked = True
ignores_quoted_identifier_case = True
ignores_table_name_case = True
order_by_nulls_first = True
requires_literal_defaults = True
requires_sqlparse_for_splitting = False
supports_boolean_expr_in_select_clause = False
supports_covering_indexes = True
supports_deferrable_unique_constraints = False
supports_expression_indexes = False
supports_ignore_conflicts = False
supports_index_on_text_field = False
supports_json_field_contains = False
supports_order_by_nulls_modifier = False
supports_over_clause = True
supports_paramstyle_pyformat = False
supports_primitives_in_json_field = False
supports_regex_backreferencing = True
supports_sequence_reset = False
supports_subqueries_in_group_by = False
supports_tablespaces = True
supports_temporal_subtraction = True
supports_timezones = False
supports_transactions = True
uses_savepoints = True
@cached_property
def has_bulk_insert(self):
return self.connection.sql_server_version > 2005
@cached_property
def supports_nullable_unique_constraints(self):
return self.connection.sql_server_version > 2005
@cached_property
def supports_partially_nullable_unique_constraints(self):
return self.connection.sql_server_version > 2005
@cached_property
def supports_partial_indexes(self):
return self.connection.sql_server_version > 2005
@cached_property
def supports_functions_in_partial_indexes(self):
return self.connection.sql_server_version > 2005
@cached_property
def has_zoneinfo_database(self):
with self.connection.cursor() as cursor:
cursor.execute("SELECT TOP 1 1 FROM sys.time_zone_info")
return cursor.fetchone() is not None
@cached_property
def supports_json_field(self):
return self.connection.sql_server_version >= 2016