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
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
|
/*[clinic input]
preserve
[clinic start generated code]*/
PyDoc_STRVAR(pysqlite_connection_cursor__doc__,
"cursor($self, /, factory=<unrepresentable>)\n"
"--\n"
"\n"
"Return a cursor for the connection.");
#define PYSQLITE_CONNECTION_CURSOR_METHODDEF \
{"cursor", (PyCFunction)(void(*)(void))pysqlite_connection_cursor, METH_FASTCALL|METH_KEYWORDS, pysqlite_connection_cursor__doc__},
static PyObject *
pysqlite_connection_cursor_impl(pysqlite_Connection *self, PyObject *factory);
static PyObject *
pysqlite_connection_cursor(pysqlite_Connection *self, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
{
PyObject *return_value = NULL;
static const char * const _keywords[] = {"factory", NULL};
static _PyArg_Parser _parser = {NULL, _keywords, "cursor", 0};
PyObject *argsbuf[1];
Py_ssize_t noptargs = nargs + (kwnames ? PyTuple_GET_SIZE(kwnames) : 0) - 0;
PyObject *factory = NULL;
args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 0, 1, 0, argsbuf);
if (!args) {
goto exit;
}
if (!noptargs) {
goto skip_optional_pos;
}
factory = args[0];
skip_optional_pos:
return_value = pysqlite_connection_cursor_impl(self, factory);
exit:
return return_value;
}
PyDoc_STRVAR(pysqlite_connection_close__doc__,
"close($self, /)\n"
"--\n"
"\n"
"Closes the connection.");
#define PYSQLITE_CONNECTION_CLOSE_METHODDEF \
{"close", (PyCFunction)pysqlite_connection_close, METH_NOARGS, pysqlite_connection_close__doc__},
static PyObject *
pysqlite_connection_close_impl(pysqlite_Connection *self);
static PyObject *
pysqlite_connection_close(pysqlite_Connection *self, PyObject *Py_UNUSED(ignored))
{
return pysqlite_connection_close_impl(self);
}
PyDoc_STRVAR(pysqlite_connection_rollback__doc__,
"rollback($self, /)\n"
"--\n"
"\n"
"Roll back the current transaction.");
#define PYSQLITE_CONNECTION_ROLLBACK_METHODDEF \
{"rollback", (PyCFunction)pysqlite_connection_rollback, METH_NOARGS, pysqlite_connection_rollback__doc__},
static PyObject *
pysqlite_connection_rollback_impl(pysqlite_Connection *self);
static PyObject *
pysqlite_connection_rollback(pysqlite_Connection *self, PyObject *Py_UNUSED(ignored))
{
return pysqlite_connection_rollback_impl(self);
}
PyDoc_STRVAR(pysqlite_connection_create_function__doc__,
"create_function($self, /, name, narg, func, *, deterministic=False)\n"
"--\n"
"\n"
"Creates a new function. Non-standard.");
#define PYSQLITE_CONNECTION_CREATE_FUNCTION_METHODDEF \
{"create_function", (PyCFunction)(void(*)(void))pysqlite_connection_create_function, METH_FASTCALL|METH_KEYWORDS, pysqlite_connection_create_function__doc__},
static PyObject *
pysqlite_connection_create_function_impl(pysqlite_Connection *self,
const char *name, int narg,
PyObject *func, int deterministic);
static PyObject *
pysqlite_connection_create_function(pysqlite_Connection *self, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
{
PyObject *return_value = NULL;
static const char * const _keywords[] = {"name", "narg", "func", "deterministic", NULL};
static _PyArg_Parser _parser = {NULL, _keywords, "create_function", 0};
PyObject *argsbuf[4];
Py_ssize_t noptargs = nargs + (kwnames ? PyTuple_GET_SIZE(kwnames) : 0) - 3;
const char *name;
int narg;
PyObject *func;
int deterministic = 0;
args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 3, 3, 0, argsbuf);
if (!args) {
goto exit;
}
if (!PyUnicode_Check(args[0])) {
_PyArg_BadArgument("create_function", "argument 'name'", "str", args[0]);
goto exit;
}
Py_ssize_t name_length;
name = PyUnicode_AsUTF8AndSize(args[0], &name_length);
if (name == NULL) {
goto exit;
}
if (strlen(name) != (size_t)name_length) {
PyErr_SetString(PyExc_ValueError, "embedded null character");
goto exit;
}
narg = _PyLong_AsInt(args[1]);
if (narg == -1 && PyErr_Occurred()) {
goto exit;
}
func = args[2];
if (!noptargs) {
goto skip_optional_kwonly;
}
deterministic = PyObject_IsTrue(args[3]);
if (deterministic < 0) {
goto exit;
}
skip_optional_kwonly:
return_value = pysqlite_connection_create_function_impl(self, name, narg, func, deterministic);
exit:
return return_value;
}
PyDoc_STRVAR(pysqlite_connection_create_aggregate__doc__,
"create_aggregate($self, /, name, n_arg, aggregate_class)\n"
"--\n"
"\n"
"Creates a new aggregate. Non-standard.");
#define PYSQLITE_CONNECTION_CREATE_AGGREGATE_METHODDEF \
{"create_aggregate", (PyCFunction)(void(*)(void))pysqlite_connection_create_aggregate, METH_FASTCALL|METH_KEYWORDS, pysqlite_connection_create_aggregate__doc__},
static PyObject *
pysqlite_connection_create_aggregate_impl(pysqlite_Connection *self,
const char *name, int n_arg,
PyObject *aggregate_class);
static PyObject *
pysqlite_connection_create_aggregate(pysqlite_Connection *self, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
{
PyObject *return_value = NULL;
static const char * const _keywords[] = {"name", "n_arg", "aggregate_class", NULL};
static _PyArg_Parser _parser = {NULL, _keywords, "create_aggregate", 0};
PyObject *argsbuf[3];
const char *name;
int n_arg;
PyObject *aggregate_class;
args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 3, 3, 0, argsbuf);
if (!args) {
goto exit;
}
if (!PyUnicode_Check(args[0])) {
_PyArg_BadArgument("create_aggregate", "argument 'name'", "str", args[0]);
goto exit;
}
Py_ssize_t name_length;
name = PyUnicode_AsUTF8AndSize(args[0], &name_length);
if (name == NULL) {
goto exit;
}
if (strlen(name) != (size_t)name_length) {
PyErr_SetString(PyExc_ValueError, "embedded null character");
goto exit;
}
n_arg = _PyLong_AsInt(args[1]);
if (n_arg == -1 && PyErr_Occurred()) {
goto exit;
}
aggregate_class = args[2];
return_value = pysqlite_connection_create_aggregate_impl(self, name, n_arg, aggregate_class);
exit:
return return_value;
}
PyDoc_STRVAR(pysqlite_connection_set_authorizer__doc__,
"set_authorizer($self, /, authorizer_callback)\n"
"--\n"
"\n"
"Sets authorizer callback. Non-standard.");
#define PYSQLITE_CONNECTION_SET_AUTHORIZER_METHODDEF \
{"set_authorizer", (PyCFunction)(void(*)(void))pysqlite_connection_set_authorizer, METH_FASTCALL|METH_KEYWORDS, pysqlite_connection_set_authorizer__doc__},
static PyObject *
pysqlite_connection_set_authorizer_impl(pysqlite_Connection *self,
PyObject *authorizer_cb);
static PyObject *
pysqlite_connection_set_authorizer(pysqlite_Connection *self, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
{
PyObject *return_value = NULL;
static const char * const _keywords[] = {"authorizer_callback", NULL};
static _PyArg_Parser _parser = {NULL, _keywords, "set_authorizer", 0};
PyObject *argsbuf[1];
PyObject *authorizer_cb;
args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 1, 1, 0, argsbuf);
if (!args) {
goto exit;
}
authorizer_cb = args[0];
return_value = pysqlite_connection_set_authorizer_impl(self, authorizer_cb);
exit:
return return_value;
}
PyDoc_STRVAR(pysqlite_connection_set_progress_handler__doc__,
"set_progress_handler($self, /, progress_handler, n)\n"
"--\n"
"\n"
"Sets progress handler callback. Non-standard.");
#define PYSQLITE_CONNECTION_SET_PROGRESS_HANDLER_METHODDEF \
{"set_progress_handler", (PyCFunction)(void(*)(void))pysqlite_connection_set_progress_handler, METH_FASTCALL|METH_KEYWORDS, pysqlite_connection_set_progress_handler__doc__},
static PyObject *
pysqlite_connection_set_progress_handler_impl(pysqlite_Connection *self,
PyObject *progress_handler,
int n);
static PyObject *
pysqlite_connection_set_progress_handler(pysqlite_Connection *self, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
{
PyObject *return_value = NULL;
static const char * const _keywords[] = {"progress_handler", "n", NULL};
static _PyArg_Parser _parser = {NULL, _keywords, "set_progress_handler", 0};
PyObject *argsbuf[2];
PyObject *progress_handler;
int n;
args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 2, 2, 0, argsbuf);
if (!args) {
goto exit;
}
progress_handler = args[0];
n = _PyLong_AsInt(args[1]);
if (n == -1 && PyErr_Occurred()) {
goto exit;
}
return_value = pysqlite_connection_set_progress_handler_impl(self, progress_handler, n);
exit:
return return_value;
}
PyDoc_STRVAR(pysqlite_connection_set_trace_callback__doc__,
"set_trace_callback($self, trace_callback, /)\n"
"--\n"
"\n"
"Sets a trace callback called for each SQL statement (passed as unicode).\n"
"\n"
"Non-standard.");
#define PYSQLITE_CONNECTION_SET_TRACE_CALLBACK_METHODDEF \
{"set_trace_callback", (PyCFunction)pysqlite_connection_set_trace_callback, METH_O, pysqlite_connection_set_trace_callback__doc__},
#if !defined(SQLITE_OMIT_LOAD_EXTENSION)
PyDoc_STRVAR(pysqlite_connection_enable_load_extension__doc__,
"enable_load_extension($self, enable, /)\n"
"--\n"
"\n"
"Enable dynamic loading of SQLite extension modules. Non-standard.");
#define PYSQLITE_CONNECTION_ENABLE_LOAD_EXTENSION_METHODDEF \
{"enable_load_extension", (PyCFunction)pysqlite_connection_enable_load_extension, METH_O, pysqlite_connection_enable_load_extension__doc__},
static PyObject *
pysqlite_connection_enable_load_extension_impl(pysqlite_Connection *self,
int onoff);
static PyObject *
pysqlite_connection_enable_load_extension(pysqlite_Connection *self, PyObject *arg)
{
PyObject *return_value = NULL;
int onoff;
onoff = _PyLong_AsInt(arg);
if (onoff == -1 && PyErr_Occurred()) {
goto exit;
}
return_value = pysqlite_connection_enable_load_extension_impl(self, onoff);
exit:
return return_value;
}
#endif /* !defined(SQLITE_OMIT_LOAD_EXTENSION) */
#if !defined(SQLITE_OMIT_LOAD_EXTENSION)
PyDoc_STRVAR(pysqlite_connection_load_extension__doc__,
"load_extension($self, name, /)\n"
"--\n"
"\n"
"Load SQLite extension module. Non-standard.");
#define PYSQLITE_CONNECTION_LOAD_EXTENSION_METHODDEF \
{"load_extension", (PyCFunction)pysqlite_connection_load_extension, METH_O, pysqlite_connection_load_extension__doc__},
static PyObject *
pysqlite_connection_load_extension_impl(pysqlite_Connection *self,
const char *extension_name);
static PyObject *
pysqlite_connection_load_extension(pysqlite_Connection *self, PyObject *arg)
{
PyObject *return_value = NULL;
const char *extension_name;
if (!PyUnicode_Check(arg)) {
_PyArg_BadArgument("load_extension", "argument", "str", arg);
goto exit;
}
Py_ssize_t extension_name_length;
extension_name = PyUnicode_AsUTF8AndSize(arg, &extension_name_length);
if (extension_name == NULL) {
goto exit;
}
if (strlen(extension_name) != (size_t)extension_name_length) {
PyErr_SetString(PyExc_ValueError, "embedded null character");
goto exit;
}
return_value = pysqlite_connection_load_extension_impl(self, extension_name);
exit:
return return_value;
}
#endif /* !defined(SQLITE_OMIT_LOAD_EXTENSION) */
PyDoc_STRVAR(pysqlite_connection_interrupt__doc__,
"interrupt($self, /)\n"
"--\n"
"\n"
"Abort any pending database operation. Non-standard.");
#define PYSQLITE_CONNECTION_INTERRUPT_METHODDEF \
{"interrupt", (PyCFunction)pysqlite_connection_interrupt, METH_NOARGS, pysqlite_connection_interrupt__doc__},
static PyObject *
pysqlite_connection_interrupt_impl(pysqlite_Connection *self);
static PyObject *
pysqlite_connection_interrupt(pysqlite_Connection *self, PyObject *Py_UNUSED(ignored))
{
return pysqlite_connection_interrupt_impl(self);
}
PyDoc_STRVAR(pysqlite_connection_iterdump__doc__,
"iterdump($self, /)\n"
"--\n"
"\n"
"Returns iterator to the dump of the database in an SQL text format.\n"
"\n"
"Non-standard.");
#define PYSQLITE_CONNECTION_ITERDUMP_METHODDEF \
{"iterdump", (PyCFunction)pysqlite_connection_iterdump, METH_NOARGS, pysqlite_connection_iterdump__doc__},
static PyObject *
pysqlite_connection_iterdump_impl(pysqlite_Connection *self);
static PyObject *
pysqlite_connection_iterdump(pysqlite_Connection *self, PyObject *Py_UNUSED(ignored))
{
return pysqlite_connection_iterdump_impl(self);
}
PyDoc_STRVAR(pysqlite_connection_create_collation__doc__,
"create_collation($self, name, callback, /)\n"
"--\n"
"\n"
"Creates a collation function. Non-standard.");
#define PYSQLITE_CONNECTION_CREATE_COLLATION_METHODDEF \
{"create_collation", (PyCFunction)(void(*)(void))pysqlite_connection_create_collation, METH_FASTCALL, pysqlite_connection_create_collation__doc__},
static PyObject *
pysqlite_connection_create_collation_impl(pysqlite_Connection *self,
PyObject *name, PyObject *callable);
static PyObject *
pysqlite_connection_create_collation(pysqlite_Connection *self, PyObject *const *args, Py_ssize_t nargs)
{
PyObject *return_value = NULL;
PyObject *name;
PyObject *callable;
if (!_PyArg_CheckPositional("create_collation", nargs, 2, 2)) {
goto exit;
}
if (!PyUnicode_Check(args[0])) {
_PyArg_BadArgument("create_collation", "argument 1", "str", args[0]);
goto exit;
}
if (PyUnicode_READY(args[0]) == -1) {
goto exit;
}
name = args[0];
callable = args[1];
return_value = pysqlite_connection_create_collation_impl(self, name, callable);
exit:
return return_value;
}
PyDoc_STRVAR(pysqlite_connection_enter__doc__,
"__enter__($self, /)\n"
"--\n"
"\n"
"Called when the connection is used as a context manager.\n"
"\n"
"Returns itself as a convenience to the caller.");
#define PYSQLITE_CONNECTION_ENTER_METHODDEF \
{"__enter__", (PyCFunction)pysqlite_connection_enter, METH_NOARGS, pysqlite_connection_enter__doc__},
static PyObject *
pysqlite_connection_enter_impl(pysqlite_Connection *self);
static PyObject *
pysqlite_connection_enter(pysqlite_Connection *self, PyObject *Py_UNUSED(ignored))
{
return pysqlite_connection_enter_impl(self);
}
PyDoc_STRVAR(pysqlite_connection_exit__doc__,
"__exit__($self, type, value, traceback, /)\n"
"--\n"
"\n"
"Called when the connection is used as a context manager.\n"
"\n"
"If there was any exception, a rollback takes place; otherwise we commit.");
#define PYSQLITE_CONNECTION_EXIT_METHODDEF \
{"__exit__", (PyCFunction)(void(*)(void))pysqlite_connection_exit, METH_FASTCALL, pysqlite_connection_exit__doc__},
static PyObject *
pysqlite_connection_exit_impl(pysqlite_Connection *self, PyObject *exc_type,
PyObject *exc_value, PyObject *exc_tb);
static PyObject *
pysqlite_connection_exit(pysqlite_Connection *self, PyObject *const *args, Py_ssize_t nargs)
{
PyObject *return_value = NULL;
PyObject *exc_type;
PyObject *exc_value;
PyObject *exc_tb;
if (!_PyArg_CheckPositional("__exit__", nargs, 3, 3)) {
goto exit;
}
exc_type = args[0];
exc_value = args[1];
exc_tb = args[2];
return_value = pysqlite_connection_exit_impl(self, exc_type, exc_value, exc_tb);
exit:
return return_value;
}
#ifndef PYSQLITE_CONNECTION_ENABLE_LOAD_EXTENSION_METHODDEF
#define PYSQLITE_CONNECTION_ENABLE_LOAD_EXTENSION_METHODDEF
#endif /* !defined(PYSQLITE_CONNECTION_ENABLE_LOAD_EXTENSION_METHODDEF) */
#ifndef PYSQLITE_CONNECTION_LOAD_EXTENSION_METHODDEF
#define PYSQLITE_CONNECTION_LOAD_EXTENSION_METHODDEF
#endif /* !defined(PYSQLITE_CONNECTION_LOAD_EXTENSION_METHODDEF) */
/*[clinic end generated code: output=e14085c0abc0a407 input=a9049054013a1b77]*/
|