mysqlengine 1.0.1__cp313-cp313-macosx_11_0_arm64.whl → 1.0.3__cp313-cp313-macosx_11_0_arm64.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.
Binary file
mysqlengine/dml.pxd ADDED
@@ -0,0 +1,387 @@
1
+ # cython: language_level=3
2
+ from sqlcycli.aio.pool cimport Pool, PoolConnection, PoolSyncConnection
3
+ from mysqlengine.element cimport Element
4
+
5
+ # Clause
6
+ cdef class CLAUSE:
7
+ cdef:
8
+ # Index Hints
9
+ list _index_hints
10
+ # Conditions
11
+ list _conditions
12
+ dict _in_conditions
13
+ dict _not_in_conditions
14
+ # Internal
15
+ Py_ssize_t _hashcode
16
+ # Compose
17
+ cpdef str clause(self, str pad=?)
18
+ # Index Hints
19
+ cdef inline bint _add_index_hints(self, INDEX_HINTS index_hints) except -1
20
+ cdef inline str _attach_index_hints(self, str clause, str pad=?)
21
+ # Conditions
22
+ cdef inline str _validate_condition(self, str cond)
23
+ cdef inline list _prepare_conditions(self, str pad=?)
24
+
25
+ # . Select Clause
26
+ cdef class SELECT(CLAUSE):
27
+ cdef:
28
+ list _expressions
29
+ bint _distinct
30
+ bint _high_priority
31
+ bint _straight_join
32
+ bint _sql_buffer_result
33
+ cpdef SELECT setup(self, list expressions, bint distinct=?, bint high_priority=?, bint straight_join=?, bint sql_buffer_result=?)
34
+ cpdef str clause(self, str pad=?)
35
+
36
+ cdef class FROM(CLAUSE):
37
+ cdef:
38
+ object _table_reference
39
+ list _partition
40
+ str _alias
41
+ cpdef FROM setup(self, object table_reference, list partition, str alias)
42
+ cpdef str clause(self, str pad=?)
43
+
44
+ cdef class JOIN(CLAUSE):
45
+ cdef:
46
+ str _join_method
47
+ object _table_reference
48
+ list _partition
49
+ list _using_columns
50
+ str _alias
51
+ cpdef JOIN setup(self, str join_method, object table_reference, list partition, list on_conditions, list using_columns, str alias)
52
+ cpdef str clause(self, str pad=?)
53
+
54
+ cdef class INDEX_HINTS(CLAUSE):
55
+ cdef:
56
+ str _mode
57
+ list _indexes
58
+ str _scope
59
+ cpdef INDEX_HINTS setup(self, str mode, list indexes, str scope)
60
+ cpdef str clause(self, str pad=?)
61
+
62
+ cdef class WHERE(CLAUSE):
63
+ cpdef WHERE setup(self, list conditions, dict in_conditions, dict not_in_conditions)
64
+ cpdef str clause(self, str pad=?)
65
+
66
+ cdef class GROUP_BY(CLAUSE):
67
+ cdef:
68
+ list _columns
69
+ bint _with_rollup
70
+ cpdef GROUP_BY setup(self, list columns, bint with_rollup)
71
+ cpdef str clause(self, str pad=?)
72
+
73
+ cdef class HAVING(CLAUSE):
74
+ cpdef HAVING setup(self, list conditions, dict in_conditions, dict not_in_conditions)
75
+ cpdef str clause(self, str pad=?)
76
+
77
+ cdef class WINDOW(CLAUSE):
78
+ cdef:
79
+ str _name
80
+ list _options
81
+ bint _primary
82
+ cpdef WINDOW setup(self, str name, list options)
83
+ cpdef str clause(self, str pad=?)
84
+
85
+ cdef class SET_OPERATION(CLAUSE):
86
+ cdef:
87
+ str _operation
88
+ SelectDML _subquery
89
+ bint _all
90
+ cpdef SET_OPERATION setup(self, str operation, SelectDML subquery, bint all)
91
+ cpdef str clause(self, str pad=?)
92
+
93
+ cdef class ORDER_BY(CLAUSE):
94
+ cdef:
95
+ list _columns
96
+ bint _with_rollup
97
+ cpdef ORDER_BY setup(self, list columns, bint with_rollup)
98
+ cpdef str clause(self, str pad=?)
99
+
100
+ cdef class LIMIT(CLAUSE):
101
+ cdef:
102
+ unsigned long long _row_count
103
+ unsigned long long _offset
104
+ cpdef LIMIT setup(self, unsigned long long row_count, unsigned long long offset)
105
+ cpdef str clause(self, str pad=?)
106
+
107
+ cdef class LOCKING_READS(CLAUSE):
108
+ cdef:
109
+ str _mode
110
+ list _tables
111
+ str _option
112
+ cpdef LOCKING_READS setup(self, str mode, list tables, str option)
113
+ cpdef str clause(self, str pad=?)
114
+
115
+ cdef class INTO_VARIABLES(CLAUSE):
116
+ cdef:
117
+ list _variables
118
+ cpdef INTO_VARIABLES setup(self, list variables)
119
+ cpdef str clause(self, str pad=?)
120
+
121
+ # . Insert Clause
122
+ cdef class INSERT(CLAUSE):
123
+ cdef:
124
+ str _table
125
+ list _partition
126
+ bint _ignore
127
+ str _priority
128
+ bint _replace_mode
129
+ cpdef INSERT setup(self, str table, list partition, bint ignore, str priority)
130
+ cdef inline bint _set_replace_mode(self, bint replace_mode) except -1
131
+ cpdef str clause(self, str pad=?)
132
+
133
+ cdef class INSERT_COLUMNS(CLAUSE):
134
+ cdef:
135
+ list _columns
136
+ cpdef INSERT_COLUMNS setup(self, list columns)
137
+ cpdef str clause(self, str pad=?)
138
+
139
+ cdef class INSERT_VALUES(CLAUSE):
140
+ cdef:
141
+ int _placeholders
142
+ ROW_ALIAS _row_alias
143
+ cpdef INSERT_VALUES setup(self, int placeholders)
144
+ cdef inline bint _add_row_alias(self, ROW_ALIAS row_alias) except -1
145
+ cpdef str clause(self, str pad=?)
146
+
147
+ cdef class SET(CLAUSE):
148
+ cdef:
149
+ list _assignments
150
+ ROW_ALIAS _row_alias
151
+ cpdef SET setup(self, list assignments)
152
+ cdef inline bint _add_row_alias(self, ROW_ALIAS row_alias) except -1
153
+ cpdef str clause(self, str pad=?)
154
+
155
+ cdef class ROW_ALIAS(CLAUSE):
156
+ cdef:
157
+ str _row_alias
158
+ list _col_alias
159
+ cpdef ROW_ALIAS setup(self, str row_alias, list col_alias)
160
+ cpdef str clause(self, str pad=?)
161
+
162
+ cdef class ON_DUPLICATE(CLAUSE):
163
+ cdef:
164
+ list _assignments
165
+ cpdef ON_DUPLICATE setup(self, list assignments)
166
+ cpdef str clause(self, str pad=?)
167
+
168
+ # . Update Clause
169
+ cdef class UPDATE(CLAUSE):
170
+ cdef:
171
+ object _table_reference
172
+ list _partition
173
+ bint _ignore
174
+ bint _low_priority
175
+ str _alias
176
+ cpdef UPDATE setup(self, object table_reference, list partition, bint ignore, bint low_priority, str alias)
177
+ cpdef str clause(self, str pad=?)
178
+
179
+ # . Delete Clause
180
+ cdef class DELETE(CLAUSE):
181
+ cdef:
182
+ object _table_reference
183
+ list _partition
184
+ bint _ignore
185
+ bint _low_priority
186
+ bint _quick
187
+ str _alias
188
+ list _multi_tables
189
+ cpdef DELETE setup(self, object table_reference, list partition, bint ignore, bint low_priority, bint quick, str alias, list multi_tables)
190
+ cpdef bint _has_multi_tables(self) except -1
191
+ cpdef str clause(self, str pad=?)
192
+
193
+ # . WITH Clause
194
+ cdef class WITH(CLAUSE):
195
+ cdef:
196
+ str _name
197
+ object _subquery
198
+ list _columns
199
+ bint _recursive
200
+ bint _primary
201
+ cpdef WITH setup(self, str name, object subquery, list columns, bint recursive)
202
+ cpdef str clause(self, str pad=?)
203
+
204
+ # DML
205
+ cdef class DML:
206
+ cdef:
207
+ # settings
208
+ str _dml
209
+ str _db_name
210
+ Pool _pool
211
+ # clauses
212
+ list _with_clauses
213
+ SELECT _select_clause
214
+ FROM _from_clause
215
+ list _join_clauses
216
+ WHERE _where_clause
217
+ GROUP_BY _group_by_clause
218
+ HAVING _having_clause
219
+ list _window_clauses
220
+ list _set_op_clauses
221
+ ORDER_BY _order_by_clause
222
+ LIMIT _limit_clause
223
+ list _locking_reads_clauses
224
+ INTO_VARIABLES _into_clause
225
+ # connection
226
+ bint _require_conn
227
+ PoolSyncConnection _sync_conn
228
+ PoolConnection _async_conn
229
+ # internal
230
+ int _clause_id
231
+ int _tb_id
232
+ bint _multi_table
233
+ Py_ssize_t _hashcode
234
+ # Connection
235
+ cpdef bint _set_connection(self, PoolSyncConnection sync_conn=?, PoolConnection async_conn=?) except -1
236
+ # SELECT Clause
237
+ cpdef SELECT _gen_select_clause(self, tuple expressions, bint distinct=?, bint high_priority=?, bint straight_join=?, bint sql_buffer_result=?)
238
+ cpdef FROM _gen_from_clause(self, object table, object partition=?, object alias=?)
239
+ cdef inline JOIN _gen_join_clause(self, str join_method, object table, tuple on, object using=?, bint require_condition=?, object partition=?, object alias=?)
240
+ cpdef JOIN _gen_inner_join_clause(self, object table, tuple on, object using=?, object partition=?, object alias=?)
241
+ cpdef JOIN _gen_left_join_clause(self, object table, tuple on, object using=?, object partition=?, object alias=?)
242
+ cpdef JOIN _gen_right_join_clause(self, object table, tuple on, object using=?, object partition=?, object alias=?)
243
+ cpdef JOIN _gen_straight_join_clause(self, object table, tuple on, object using=?, object partition=?, object alias=?)
244
+ cpdef JOIN _gen_cross_join_clause(self, object table, tuple on, object using=?, object partition=?, object alias=?)
245
+ cpdef JOIN _gen_natural_join_clause(self, object table, object join_method=?, object partition=?, object alias=?)
246
+ cdef INDEX_HINTS _gen_index_hints_clause(self, str mode, tuple indexes, object scope=?)
247
+ cpdef INDEX_HINTS _gen_use_index_clause(self, tuple indexes, object scope=?)
248
+ cpdef INDEX_HINTS _gen_ignore_index_clause(self, tuple indexes, object scope=?)
249
+ cpdef INDEX_HINTS _gen_force_index_clause(self, tuple indexes, object scope=?)
250
+ cpdef WHERE _gen_where_clause(self, tuple conds, object in_conds=?, object not_in_conds=?)
251
+ cpdef GROUP_BY _gen_group_by_clause(self, tuple columns, bint with_rollup=?)
252
+ cpdef HAVING _gen_having_clause(self, tuple conds, object in_conds=?, object not_in_conds=?)
253
+ cpdef WINDOW _gen_window_clause(self, object name, object partition_by=?, object order_by=?, object frame_clause=?)
254
+ cpdef SET_OPERATION _gen_union_clause(self, object subquery, bint all=?)
255
+ cpdef SET_OPERATION _gen_intersect_clause(self, object subquery, bint all=?)
256
+ cpdef SET_OPERATION _gen_except_clause(self, object subquery, bint all=?)
257
+ cpdef ORDER_BY _gen_order_by_clause(self, tuple columns, bint with_rollup=?)
258
+ cpdef LIMIT _gen_limit_clause(self, object row_count, object offset=?)
259
+ cdef inline LOCKING_READS _gen_locking_reads_clause(self, str mode, tuple tables, object option=?)
260
+ cpdef LOCKING_READS _gen_for_update_clause(self, tuple tables, object option=?)
261
+ cpdef LOCKING_READS _gen_for_share_clause(self, tuple tables, object option=?)
262
+ cpdef INTO_VARIABLES _gen_into_variables_clause(self, tuple variables)
263
+ # INSERT Clause
264
+ cpdef INSERT _gen_insert_clause(self, object table, object partition=?, bint ignore=?, object priority=?)
265
+ cpdef INSERT_COLUMNS _gen_insert_columns_clause(self, tuple columns)
266
+ cpdef INSERT_VALUES _gen_insert_values_clause(self, int placeholders)
267
+ cpdef SET _gen_set_clause(self, tuple assignments)
268
+ cpdef ROW_ALIAS _gen_row_alias_clause(self, object row_alias, tuple col_alias)
269
+ cpdef ON_DUPLICATE _gen_on_duplicate_clause(self, tuple assignments)
270
+ # UPDATE Clause
271
+ cpdef UPDATE _gen_update_clause(self, object table, object partition=?, bint ignore=?, bint low_priority=?, object alias=?)
272
+ # DELETE Clause
273
+ cpdef DELETE _gen_delete_clause(self, object table, object partition=?, bint ignore=?, bint low_priority=?, bint quick=?, object alias=?, object multi_tables=?)
274
+ # WITH Clause
275
+ cpdef WITH _gen_with_clause(self, object name, object subquery, tuple columns, bint recursive=?)
276
+ # Statement
277
+ cpdef str statement(self, int indent=?)
278
+ cdef inline str _gen_select_statement(self, str pad=?)
279
+ cdef inline str _gen_select_subquery(self, str pad=?)
280
+ # Execute
281
+ cpdef object _Execute(self, object args=?, object cursor=?, bint fetch=?, bint many=?, object conn=?)
282
+ # Validate
283
+ cdef inline str _validate_element_name(self, str name, str msg)
284
+ cdef inline str _validate_element(self, object element, str msg)
285
+ cdef inline list _validate_elements(self, object elements, str msg)
286
+ cdef inline str _validate_table(self, object table, str msg)
287
+ cdef inline list _validate_tables(self, object tables, str msg)
288
+ cdef inline str _validate_table_alias(self, object alias, str msg)
289
+ cdef inline str _validate_expression(self, object expression, str msg)
290
+ cdef inline list _validate_expressions(self, object expressions, str msg)
291
+ cdef inline dict _validate_in_conditions(self, object in_conds, str msg)
292
+ cdef inline SelectDML _validate_subquery(self, object subquery, str msg)
293
+ cdef inline str _validate_indent(self, int indent)
294
+ # Error
295
+ cdef inline bint _raise_error(self, type err_type, str msg, Exception tb_exc=?) except -1
296
+ cdef inline bint _raise_clause_error(self, str msg, Exception tb_exc=?) except -1
297
+ cdef inline bint _raise_argument_error(self, str msg, Exception tb_exc=?) except -1
298
+ cdef inline bint _raise_critical_error(self, str msg, Exception tb_exc=?) except -1
299
+ cdef inline bint _raise_not_implemented_error(self, str method_name) except -1
300
+ cdef inline bint _raise_invalid_table_element_error(self, Element element, Exception tb_exc=?) except -1
301
+ cdef inline bint _raise_clause_already_set_error(self, CLAUSE clause, Exception tb_exc=?) except -1
302
+ cdef inline bint _raise_clause_order_error(self, str clause_name, list preceding_clauses, Exception tb_exc=?) except -1
303
+
304
+ # . Select
305
+ cdef class SelectDML(DML):
306
+ # Clause
307
+ cpdef SelectDML _Select(self, tuple expressions, bint distinct=?, bint high_priority=?, bint straight_join=?, bint sql_buffer_result=?)
308
+ cpdef SelectDML From(self, object table, object partition=?, object alias=?)
309
+ # Statement
310
+ cpdef str statement(self, int indent=?)
311
+ # Execute
312
+ cpdef object Execute(self, object args=?, object cursor=?, bint fetch=?, object conn=?)
313
+ # Validate
314
+ cdef inline bint _validate_join_clause_order(self) except -1
315
+
316
+ # . Insert
317
+ cdef class InsertDML(DML):
318
+ cdef:
319
+ # clauses
320
+ INSERT _insert_clause
321
+ INSERT_COLUMNS _columns_clause
322
+ INSERT_VALUES _values_clause
323
+ SET _set_clause
324
+ ON_DUPLICATE _on_dup_key_update_clause
325
+ # internal
326
+ int _insert_mode
327
+ # Clause
328
+ cpdef InsertDML Insert(self, object table, object partition=?, bint ignore=?, object priority=?)
329
+ # Statement
330
+ cpdef str statement(self, int indent=?)
331
+ # Execute
332
+ cpdef object Execute(self, object args=?, bint many=?, object conn=?)
333
+ # Validate
334
+ cdef inline bint _validate_join_clause_order(self) except -1
335
+
336
+ # . Replace
337
+ cdef class ReplaceDML(DML):
338
+ cdef:
339
+ # clauses
340
+ INSERT _replace_clause
341
+ INSERT_COLUMNS _columns_clause
342
+ INSERT_VALUES _values_clause
343
+ SET _set_clause
344
+ # internal
345
+ int _insert_mode
346
+ # Clause
347
+ cpdef ReplaceDML Replace(self, object table, object partition=?, bint low_priority=?)
348
+ # Statement
349
+ cpdef str statement(self, int indent=?)
350
+ # Execute
351
+ cpdef object Execute(self, object args=?, bint many=?, object conn=?)
352
+ # Validate
353
+ cdef inline bint _validate_join_clause_order(self) except -1
354
+
355
+ # . Update
356
+ cdef class UpdateDML(DML):
357
+ cdef:
358
+ # clauses
359
+ UPDATE _update_clause
360
+ SET _set_clause
361
+ # Clause
362
+ cpdef UpdateDML Update(self, object table, object partition=?, bint ignore=?, bint low_priority=?, object alias=?)
363
+ # Statement
364
+ cpdef str statement(self, int indent=?)
365
+ # Execute
366
+ cpdef object Execute(self, object args=?, bint many=?, object conn=?)
367
+ # Validate
368
+ cdef inline bint _validate_join_clause_order(self) except -1
369
+
370
+ # . Delete
371
+ cdef class DeleteDML(DML):
372
+ cdef:
373
+ # clauses
374
+ DELETE _delete_clause
375
+ # Clause
376
+ cpdef DeleteDML Delete(self, object table, object partition=?, bint ignore=?, bint low_priority=?, bint quick=?, object alias=?, object multi_tables=?)
377
+ # Statement
378
+ cpdef str statement(self, int indent=?)
379
+ # Execute
380
+ cpdef object Execute(self, object args=?, bint many=?, object conn=?)
381
+ # Validate
382
+ cdef inline bint _validate_join_clause_order(self) except -1
383
+
384
+ # . With
385
+ cdef class WithDML(DML):
386
+ # Clause
387
+ cpdef WithDML _With(self, object name, object subquery, tuple columns, bint recursive=?)