-
Notifications
You must be signed in to change notification settings - Fork 29
/
Copy pathrequirements.py
244 lines (199 loc) · 7.35 KB
/
requirements.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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
from sqlalchemy.testing import exclusions
from sqlalchemy.testing.exclusions import (
BooleanPredicate,
skip_if,
)
from sqlalchemy.testing.requirements import SuiteRequirements
class Requirements(SuiteRequirements):
@property
def reflects_pk_names(self):
return exclusions.open()
@property
def index_reflection(self):
return exclusions.closed()
@property
def unique_constraint_reflection(self):
"""target dialect supports reflection of unique constraints"""
return exclusions.closed()
@property
def self_referential_foreign_keys(self):
"""Target database must support self-referential foreign keys."""
return exclusions.open()
@property
def implicitly_named_constraints(self):
"""target database must apply names to unnamed constraints."""
return exclusions.open()
@property
def returning(self):
"""target platform supports RETURNING."""
return exclusions.closed()
@property
def empty_strings_varchar(self):
"""target database can persist/return an empty string with a
varchar."""
return exclusions.closed()
@property
def text_type(self):
"""Target database must support an unbounded Text()
type such as TEXT or CLOB"""
return exclusions.closed()
@property
def datetime_microseconds(self):
"""target dialect supports representation of Python
datetime.datetime() with microsecond objects."""
return exclusions.closed()
@property
def datetime_historic(self):
"""target dialect supports representation of Python
datetime.datetime() objects with historic (pre 1970) values."""
return exclusions.open()
@property
def date_historic(self):
"""target dialect supports representation of Python
datetime.date() objects with historic (pre 1970) values."""
return exclusions.open()
@property
def time(self):
"""target dialect supports representation of Python
datetime.time() objects."""
return exclusions.closed()
@property
def time_microseconds(self):
"""target dialect supports representation of Python
datetime.time() with microsecond objects."""
return exclusions.closed()
@property
def unbounded_varchar(self):
"""Target database must support VARCHAR with no length"""
return exclusions.closed()
@property
def implements_get_lastrowid(self):
""" "target dialect implements the executioncontext.get_lastrowid()
method without reliance on RETURNING."""
return exclusions.closed()
@property
def emulated_lastrowid(self):
""" "target dialect retrieves cursor.lastrowid, or fetches
from a database-side function after an insert() construct executes,
within the get_lastrowid() method.
Only dialects that "pre-execute", or need RETURNING to get last
inserted id, would return closed/fail/skip for this.
"""
return exclusions.open()
@property
def schemas(self):
"""Target database supports named schemas"""
return exclusions.open()
@property
def views(self):
"""Target database must support VIEWs."""
return exclusions.open()
@property
def view_reflection(self):
"""Target database supports view metadata"""
return exclusions.open()
@property
def precision_numerics_enotation_large(self):
"""Dialect converts small/large scale decimals into scientific notation"""
return exclusions.open()
@property
def temporary_tables(self):
"""target database supports temporary tables"""
return exclusions.closed()
@property
def temp_table_names(self):
"""target dialect supports listing of temporary table names"""
return exclusions.closed()
@property
def temp_table_reflection(self):
return exclusions.closed()
@property
def offset(self):
"""target database can render OFFSET, or an equivalent, in a
SELECT.
"""
return exclusions.closed()
@property
def order_by_col_from_union(self):
"""target database supports ordering by a column from a SELECT
inside of a UNION
E.g. (SELECT id, ...) UNION (SELECT id, ...) ORDER BY id"""
return exclusions.open()
@property
def bound_limit_offset(self):
"""target database can render LIMIT and/or OFFSET using a bound
parameter
"""
return exclusions.closed()
@property
def duplicate_key_raises_integrity_error(self):
return exclusions.only_on(
[lambda config: config.db.dialect.driver == "pyodbc"],
reason="Currently this is only supported by pyodbc based dialects",
)
@property
def independent_connections(self):
return exclusions.open()
@property
def parens_in_union_contained_select_w_limit_offset(self):
return exclusions.closed()
@property
def parens_in_union_contained_select_wo_limit_offset(self):
return exclusions.closed()
@property
def broken_cx_oracle6_numerics(config):
return exclusions.closed()
@property
def cross_schema_fk_reflection(self):
return exclusions.closed()
@property
def ctes(self):
"""Target database supports CTEs"""
return skip_if(
BooleanPredicate(
True,
"Can't be opened as CTE tests require DB support for 'WITH RECURSIVE' not supported by EXASOL",
)
)
@property
def standalone_null_binds_whereclause(self):
"""target database/driver supports bound parameters with NULL in the
WHERE clause, in situations where it has to be typed.
"""
return exclusions.closed()
@property
def binary_literals(self):
"""target backend supports simple binary literals, e.g. an
expression like::
SELECT CAST('foo' AS BINARY)
Where ``BINARY`` is the type emitted from :class:`.LargeBinary`,
e.g. it could be ``BLOB`` or similar.
Basically fails on Oracle.
"""
return skip_if(
BooleanPredicate(
True, """A binary type is not natively supported by the EXASOL DB"""
)
)
@property
def binary_comparisons(self):
"""target database/driver can allow BLOB/BINARY fields to be compared
against a bound parameter value.
"""
return skip_if(
BooleanPredicate(
True, """A binary type is not natively supported by the EXASOL DB"""
)
)
@property
def sql_expression_limit_offset(self):
"""
This feature roughly expects the following query types to be available:
- SELECT * FROM <table> ORDER BY <col> ASC LIMIT <expr>;
- SELECT * FROM <table> ORDER BY <col> ASC LIMIT <expr> OFFSET <expr>;
- SELECT * FROM <table> ORDER BY <col> ASC LIMIT <expr> OFFSET <literal/value>;
- SELECT * FROM <table> ORDER BY <col> ASC OFFSET <expr>;
Exasol -> SELECT * FROM <table> ORDER BY <col> ASC LIMIT <offset>, <count>;
- SELECT * FROM <table> ORDER BY <col> ASC LIMIT <count> OFFSET <expr>;
"""
return skip_if(BooleanPredicate(True, """Not Implemented Yet"""))