velocity-python 0.0.109__py3-none-any.whl → 0.0.155__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- velocity/__init__.py +3 -1
- velocity/app/orders.py +3 -4
- velocity/app/tests/__init__.py +1 -0
- velocity/app/tests/test_email_processing.py +112 -0
- velocity/app/tests/test_payment_profile_sorting.py +191 -0
- velocity/app/tests/test_spreadsheet_functions.py +124 -0
- velocity/aws/__init__.py +3 -0
- velocity/aws/amplify.py +10 -6
- velocity/aws/handlers/__init__.py +2 -0
- velocity/aws/handlers/base_handler.py +248 -0
- velocity/aws/handlers/context.py +167 -2
- velocity/aws/handlers/exceptions.py +16 -0
- velocity/aws/handlers/lambda_handler.py +24 -85
- velocity/aws/handlers/mixins/__init__.py +16 -0
- velocity/aws/handlers/mixins/activity_tracker.py +181 -0
- velocity/aws/handlers/mixins/aws_session_mixin.py +192 -0
- velocity/aws/handlers/mixins/error_handler.py +192 -0
- velocity/aws/handlers/mixins/legacy_mixin.py +53 -0
- velocity/aws/handlers/mixins/standard_mixin.py +73 -0
- velocity/aws/handlers/response.py +1 -1
- velocity/aws/handlers/sqs_handler.py +28 -143
- velocity/aws/tests/__init__.py +1 -0
- velocity/aws/tests/test_lambda_handler_json_serialization.py +120 -0
- velocity/aws/tests/test_response.py +163 -0
- velocity/db/__init__.py +16 -4
- velocity/db/core/decorators.py +20 -4
- velocity/db/core/engine.py +185 -839
- velocity/db/core/result.py +30 -24
- velocity/db/core/row.py +15 -3
- velocity/db/core/table.py +279 -40
- velocity/db/core/transaction.py +19 -11
- velocity/db/exceptions.py +42 -18
- velocity/db/servers/base/__init__.py +9 -0
- velocity/db/servers/base/initializer.py +70 -0
- velocity/db/servers/base/operators.py +98 -0
- velocity/db/servers/base/sql.py +503 -0
- velocity/db/servers/base/types.py +135 -0
- velocity/db/servers/mysql/__init__.py +73 -0
- velocity/db/servers/mysql/operators.py +54 -0
- velocity/db/servers/{mysql_reserved.py → mysql/reserved.py} +2 -14
- velocity/db/servers/mysql/sql.py +718 -0
- velocity/db/servers/mysql/types.py +107 -0
- velocity/db/servers/postgres/__init__.py +59 -11
- velocity/db/servers/postgres/operators.py +34 -0
- velocity/db/servers/postgres/sql.py +474 -120
- velocity/db/servers/postgres/types.py +88 -2
- velocity/db/servers/sqlite/__init__.py +61 -0
- velocity/db/servers/sqlite/operators.py +52 -0
- velocity/db/servers/sqlite/reserved.py +20 -0
- velocity/db/servers/sqlite/sql.py +677 -0
- velocity/db/servers/sqlite/types.py +92 -0
- velocity/db/servers/sqlserver/__init__.py +73 -0
- velocity/db/servers/sqlserver/operators.py +47 -0
- velocity/db/servers/sqlserver/reserved.py +32 -0
- velocity/db/servers/sqlserver/sql.py +805 -0
- velocity/db/servers/sqlserver/types.py +114 -0
- velocity/db/servers/tablehelper.py +117 -91
- velocity/db/tests/__init__.py +1 -0
- velocity/db/tests/common_db_test.py +0 -0
- velocity/db/tests/postgres/__init__.py +1 -0
- velocity/db/tests/postgres/common.py +49 -0
- velocity/db/tests/postgres/test_column.py +29 -0
- velocity/db/tests/postgres/test_connections.py +25 -0
- velocity/db/tests/postgres/test_database.py +21 -0
- velocity/db/tests/postgres/test_engine.py +205 -0
- velocity/db/tests/postgres/test_general_usage.py +88 -0
- velocity/db/tests/postgres/test_imports.py +8 -0
- velocity/db/tests/postgres/test_result.py +19 -0
- velocity/db/tests/postgres/test_row.py +137 -0
- velocity/db/tests/postgres/test_row_comprehensive.py +720 -0
- velocity/db/tests/postgres/test_schema_locking.py +335 -0
- velocity/db/tests/postgres/test_schema_locking_unit.py +115 -0
- velocity/db/tests/postgres/test_sequence.py +34 -0
- velocity/db/tests/postgres/test_sql_comprehensive.py +462 -0
- velocity/db/tests/postgres/test_table.py +101 -0
- velocity/db/tests/postgres/test_table_comprehensive.py +646 -0
- velocity/db/tests/postgres/test_transaction.py +106 -0
- velocity/db/tests/sql/__init__.py +1 -0
- velocity/db/tests/sql/common.py +177 -0
- velocity/db/tests/sql/test_postgres_select_advanced.py +285 -0
- velocity/db/tests/sql/test_postgres_select_variances.py +517 -0
- velocity/db/tests/test_cursor_rowcount_fix.py +150 -0
- velocity/db/tests/test_db_utils.py +221 -0
- velocity/db/tests/test_postgres.py +448 -0
- velocity/db/tests/test_postgres_unchanged.py +81 -0
- velocity/db/tests/test_process_error_robustness.py +292 -0
- velocity/db/tests/test_result_caching.py +279 -0
- velocity/db/tests/test_result_sql_aware.py +117 -0
- velocity/db/tests/test_row_get_missing_column.py +72 -0
- velocity/db/tests/test_schema_locking_initializers.py +226 -0
- velocity/db/tests/test_schema_locking_simple.py +97 -0
- velocity/db/tests/test_sql_builder.py +165 -0
- velocity/db/tests/test_tablehelper.py +486 -0
- velocity/db/utils.py +62 -47
- velocity/misc/conv/__init__.py +2 -0
- velocity/misc/conv/iconv.py +5 -4
- velocity/misc/export.py +1 -4
- velocity/misc/merge.py +1 -1
- velocity/misc/tests/__init__.py +1 -0
- velocity/misc/tests/test_db.py +90 -0
- velocity/misc/tests/test_fix.py +78 -0
- velocity/misc/tests/test_format.py +64 -0
- velocity/misc/tests/test_iconv.py +203 -0
- velocity/misc/tests/test_merge.py +82 -0
- velocity/misc/tests/test_oconv.py +144 -0
- velocity/misc/tests/test_original_error.py +52 -0
- velocity/misc/tests/test_timer.py +74 -0
- velocity/misc/tools.py +0 -1
- {velocity_python-0.0.109.dist-info → velocity_python-0.0.155.dist-info}/METADATA +2 -2
- velocity_python-0.0.155.dist-info/RECORD +129 -0
- velocity/db/core/exceptions.py +0 -70
- velocity/db/servers/mysql.py +0 -641
- velocity/db/servers/sqlite.py +0 -968
- velocity/db/servers/sqlite_reserved.py +0 -208
- velocity/db/servers/sqlserver.py +0 -921
- velocity/db/servers/sqlserver_reserved.py +0 -314
- velocity_python-0.0.109.dist-info/RECORD +0 -56
- {velocity_python-0.0.109.dist-info → velocity_python-0.0.155.dist-info}/WHEEL +0 -0
- {velocity_python-0.0.109.dist-info → velocity_python-0.0.155.dist-info}/licenses/LICENSE +0 -0
- {velocity_python-0.0.109.dist-info → velocity_python-0.0.155.dist-info}/top_level.txt +0 -0
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
from ..base.operators import BaseOperators
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
class MySQLOperators(BaseOperators):
|
|
5
|
+
"""
|
|
6
|
+
MySQL-specific operator mappings.
|
|
7
|
+
"""
|
|
8
|
+
|
|
9
|
+
@classmethod
|
|
10
|
+
def get_operators(cls):
|
|
11
|
+
"""Returns MySQL-specific operator mappings."""
|
|
12
|
+
return OPERATORS
|
|
13
|
+
|
|
14
|
+
@classmethod
|
|
15
|
+
def supports_case_insensitive_like(cls):
|
|
16
|
+
"""MySQL LIKE is case-insensitive by default on case-insensitive collations."""
|
|
17
|
+
return False # Depends on collation, but generally need to use LOWER()
|
|
18
|
+
|
|
19
|
+
@classmethod
|
|
20
|
+
def supports_regex(cls):
|
|
21
|
+
"""MySQL supports REGEXP/RLIKE operators."""
|
|
22
|
+
return True
|
|
23
|
+
|
|
24
|
+
@classmethod
|
|
25
|
+
def get_regex_operators(cls):
|
|
26
|
+
"""Returns MySQL regex operators."""
|
|
27
|
+
return {
|
|
28
|
+
"REGEXP": "REGEXP",
|
|
29
|
+
"RLIKE": "RLIKE",
|
|
30
|
+
"NOT REGEXP": "NOT REGEXP",
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
OPERATORS = {
|
|
35
|
+
"<>": "<>",
|
|
36
|
+
"!=": "<>",
|
|
37
|
+
"!><": "NOT BETWEEN",
|
|
38
|
+
">!<": "NOT BETWEEN",
|
|
39
|
+
"><": "BETWEEN",
|
|
40
|
+
"%%": "LIKE", # MySQL doesn't have ILIKE, use LIKE with LOWER()
|
|
41
|
+
"!%%": "NOT LIKE",
|
|
42
|
+
"==": "=",
|
|
43
|
+
"<=": "<=",
|
|
44
|
+
">=": ">=",
|
|
45
|
+
"<": "<",
|
|
46
|
+
">": ">",
|
|
47
|
+
"%": "LIKE",
|
|
48
|
+
"!%": "NOT LIKE",
|
|
49
|
+
"=": "=",
|
|
50
|
+
"!": "<>",
|
|
51
|
+
"REGEXP": "REGEXP",
|
|
52
|
+
"!REGEXP": "NOT REGEXP",
|
|
53
|
+
"RLIKE": "RLIKE",
|
|
54
|
+
}
|
|
@@ -61,7 +61,6 @@ reserved_words = [
|
|
|
61
61
|
"ELSEIF",
|
|
62
62
|
"ENCLOSED",
|
|
63
63
|
"ESCAPED",
|
|
64
|
-
"EXCEPT",
|
|
65
64
|
"EXISTS",
|
|
66
65
|
"EXIT",
|
|
67
66
|
"EXPLAIN",
|
|
@@ -75,8 +74,6 @@ reserved_words = [
|
|
|
75
74
|
"FOREIGN",
|
|
76
75
|
"FROM",
|
|
77
76
|
"FULLTEXT",
|
|
78
|
-
"GENERATED",
|
|
79
|
-
"GET",
|
|
80
77
|
"GRANT",
|
|
81
78
|
"GROUP",
|
|
82
79
|
"HAVING",
|
|
@@ -105,7 +102,6 @@ reserved_words = [
|
|
|
105
102
|
"IS",
|
|
106
103
|
"ITERATE",
|
|
107
104
|
"JOIN",
|
|
108
|
-
"JSON",
|
|
109
105
|
"KEY",
|
|
110
106
|
"KEYS",
|
|
111
107
|
"KILL",
|
|
@@ -125,9 +121,7 @@ reserved_words = [
|
|
|
125
121
|
"LONGTEXT",
|
|
126
122
|
"LOOP",
|
|
127
123
|
"LOW_PRIORITY",
|
|
128
|
-
"MASTER_SSL_VERIFY_SERVER_CERT",
|
|
129
124
|
"MATCH",
|
|
130
|
-
"MAXVALUE",
|
|
131
125
|
"MEDIUMBLOB",
|
|
132
126
|
"MEDIUMINT",
|
|
133
127
|
"MEDIUMTEXT",
|
|
@@ -150,7 +144,6 @@ reserved_words = [
|
|
|
150
144
|
"OUT",
|
|
151
145
|
"OUTER",
|
|
152
146
|
"OUTFILE",
|
|
153
|
-
"PARTITION",
|
|
154
147
|
"PRECISION",
|
|
155
148
|
"PRIMARY",
|
|
156
149
|
"PROCEDURE",
|
|
@@ -167,14 +160,11 @@ reserved_words = [
|
|
|
167
160
|
"REPEAT",
|
|
168
161
|
"REPLACE",
|
|
169
162
|
"REQUIRE",
|
|
170
|
-
"RESIGNAL",
|
|
171
163
|
"RESTRICT",
|
|
172
164
|
"RETURN",
|
|
173
165
|
"REVOKE",
|
|
174
166
|
"RIGHT",
|
|
175
167
|
"RLIKE",
|
|
176
|
-
"ROW",
|
|
177
|
-
"ROWS",
|
|
178
168
|
"SCHEMA",
|
|
179
169
|
"SCHEMAS",
|
|
180
170
|
"SECOND_MICROSECOND",
|
|
@@ -183,7 +173,6 @@ reserved_words = [
|
|
|
183
173
|
"SEPARATOR",
|
|
184
174
|
"SET",
|
|
185
175
|
"SHOW",
|
|
186
|
-
"SIGNAL",
|
|
187
176
|
"SMALLINT",
|
|
188
177
|
"SPATIAL",
|
|
189
178
|
"SPECIFIC",
|
|
@@ -196,7 +185,6 @@ reserved_words = [
|
|
|
196
185
|
"SQL_SMALL_RESULT",
|
|
197
186
|
"SSL",
|
|
198
187
|
"STARTING",
|
|
199
|
-
"STORED",
|
|
200
188
|
"STRAIGHT_JOIN",
|
|
201
189
|
"TABLE",
|
|
202
190
|
"TERMINATED",
|
|
@@ -225,13 +213,13 @@ reserved_words = [
|
|
|
225
213
|
"VARCHAR",
|
|
226
214
|
"VARCHARACTER",
|
|
227
215
|
"VARYING",
|
|
228
|
-
"VIRTUAL",
|
|
229
216
|
"WHEN",
|
|
230
217
|
"WHERE",
|
|
231
218
|
"WHILE",
|
|
232
219
|
"WITH",
|
|
233
220
|
"WRITE",
|
|
221
|
+
"X509",
|
|
234
222
|
"XOR",
|
|
235
223
|
"YEAR_MONTH",
|
|
236
|
-
"ZEROFILL"
|
|
224
|
+
"ZEROFILL"
|
|
237
225
|
]
|