| 
									
										
										
										
											2021-01-06 00:57:25 +01:00
										 |  |  | /*[clinic input]
 | 
					
						
							|  |  |  | preserve | 
					
						
							|  |  |  | [clinic start generated code]*/ | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2022-08-11 15:25:49 -06:00
										 |  |  | #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
 | 
					
						
							| 
									
										
										
										
											2023-08-31 23:42:34 +02:00
										 |  |  | #  include "pycore_gc.h"          // PyGC_Head
 | 
					
						
							|  |  |  | #  include "pycore_runtime.h"     // _Py_ID()
 | 
					
						
							| 
									
										
										
										
											2022-08-11 15:25:49 -06:00
										 |  |  | #endif
 | 
					
						
							| 
									
										
										
										
											2023-10-17 14:30:31 +02:00
										 |  |  | #include "pycore_modsupport.h"    // _PyArg_CheckPositional()
 | 
					
						
							| 
									
										
										
										
											2022-08-11 15:25:49 -06:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-01-06 00:57:25 +01:00
										 |  |  | static int | 
					
						
							|  |  |  | pysqlite_cursor_init_impl(pysqlite_Cursor *self, | 
					
						
							|  |  |  |                           pysqlite_Connection *connection); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | static int | 
					
						
							|  |  |  | pysqlite_cursor_init(PyObject *self, PyObject *args, PyObject *kwargs) | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  |     int return_value = -1; | 
					
						
							| 
									
										
										
										
											2023-01-31 21:42:03 +01:00
										 |  |  |     PyTypeObject *base_tp = clinic_state()->CursorType; | 
					
						
							| 
									
										
										
										
											2021-01-06 00:57:25 +01:00
										 |  |  |     pysqlite_Connection *connection; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2023-01-31 21:42:03 +01:00
										 |  |  |     if ((Py_IS_TYPE(self, base_tp) || | 
					
						
							|  |  |  |          Py_TYPE(self)->tp_new == base_tp->tp_new) && | 
					
						
							| 
									
										
										
										
											2021-01-06 00:57:25 +01:00
										 |  |  |         !_PyArg_NoKeywords("Cursor", kwargs)) { | 
					
						
							|  |  |  |         goto exit; | 
					
						
							|  |  |  |     } | 
					
						
							|  |  |  |     if (!_PyArg_CheckPositional("Cursor", PyTuple_GET_SIZE(args), 1, 1)) { | 
					
						
							|  |  |  |         goto exit; | 
					
						
							|  |  |  |     } | 
					
						
							| 
									
										
										
										
											2021-06-15 14:47:34 +02:00
										 |  |  |     if (!PyObject_TypeCheck(PyTuple_GET_ITEM(args, 0), clinic_state()->ConnectionType)) { | 
					
						
							|  |  |  |         _PyArg_BadArgument("Cursor", "argument 1", (clinic_state()->ConnectionType)->tp_name, PyTuple_GET_ITEM(args, 0)); | 
					
						
							| 
									
										
										
										
											2021-01-06 00:57:25 +01:00
										 |  |  |         goto exit; | 
					
						
							|  |  |  |     } | 
					
						
							|  |  |  |     connection = (pysqlite_Connection *)PyTuple_GET_ITEM(args, 0); | 
					
						
							|  |  |  |     return_value = pysqlite_cursor_init_impl((pysqlite_Cursor *)self, connection); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | exit: | 
					
						
							|  |  |  |     return return_value; | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | PyDoc_STRVAR(pysqlite_cursor_execute__doc__, | 
					
						
							|  |  |  | "execute($self, sql, parameters=(), /)\n" | 
					
						
							|  |  |  | "--\n" | 
					
						
							|  |  |  | "\n" | 
					
						
							| 
									
										
										
										
											2022-03-11 02:52:47 +01:00
										 |  |  | "Executes an SQL statement."); | 
					
						
							| 
									
										
										
										
											2021-01-06 00:57:25 +01:00
										 |  |  | 
 | 
					
						
							|  |  |  | #define PYSQLITE_CURSOR_EXECUTE_METHODDEF    \
 | 
					
						
							| 
									
										
										
										
											2022-05-03 20:25:41 +02:00
										 |  |  |     {"execute", _PyCFunction_CAST(pysqlite_cursor_execute), METH_FASTCALL, pysqlite_cursor_execute__doc__}, | 
					
						
							| 
									
										
										
										
											2021-01-06 00:57:25 +01:00
										 |  |  | 
 | 
					
						
							|  |  |  | static PyObject * | 
					
						
							|  |  |  | pysqlite_cursor_execute_impl(pysqlite_Cursor *self, PyObject *sql, | 
					
						
							|  |  |  |                              PyObject *parameters); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | static PyObject * | 
					
						
							| 
									
										
										
										
											2025-01-20 12:40:18 +01:00
										 |  |  | pysqlite_cursor_execute(PyObject *self, PyObject *const *args, Py_ssize_t nargs) | 
					
						
							| 
									
										
										
										
											2021-01-06 00:57:25 +01:00
										 |  |  | { | 
					
						
							|  |  |  |     PyObject *return_value = NULL; | 
					
						
							|  |  |  |     PyObject *sql; | 
					
						
							|  |  |  |     PyObject *parameters = NULL; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     if (!_PyArg_CheckPositional("execute", nargs, 1, 2)) { | 
					
						
							|  |  |  |         goto exit; | 
					
						
							|  |  |  |     } | 
					
						
							|  |  |  |     if (!PyUnicode_Check(args[0])) { | 
					
						
							|  |  |  |         _PyArg_BadArgument("execute", "argument 1", "str", args[0]); | 
					
						
							|  |  |  |         goto exit; | 
					
						
							|  |  |  |     } | 
					
						
							|  |  |  |     sql = args[0]; | 
					
						
							|  |  |  |     if (nargs < 2) { | 
					
						
							|  |  |  |         goto skip_optional; | 
					
						
							|  |  |  |     } | 
					
						
							|  |  |  |     parameters = args[1]; | 
					
						
							|  |  |  | skip_optional: | 
					
						
							| 
									
										
										
										
											2025-01-20 12:40:18 +01:00
										 |  |  |     return_value = pysqlite_cursor_execute_impl((pysqlite_Cursor *)self, sql, parameters); | 
					
						
							| 
									
										
										
										
											2021-01-06 00:57:25 +01:00
										 |  |  | 
 | 
					
						
							|  |  |  | exit: | 
					
						
							|  |  |  |     return return_value; | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | PyDoc_STRVAR(pysqlite_cursor_executemany__doc__, | 
					
						
							|  |  |  | "executemany($self, sql, seq_of_parameters, /)\n" | 
					
						
							|  |  |  | "--\n" | 
					
						
							|  |  |  | "\n" | 
					
						
							| 
									
										
										
										
											2022-03-11 02:52:47 +01:00
										 |  |  | "Repeatedly executes an SQL statement."); | 
					
						
							| 
									
										
										
										
											2021-01-06 00:57:25 +01:00
										 |  |  | 
 | 
					
						
							|  |  |  | #define PYSQLITE_CURSOR_EXECUTEMANY_METHODDEF    \
 | 
					
						
							| 
									
										
										
										
											2022-05-03 20:25:41 +02:00
										 |  |  |     {"executemany", _PyCFunction_CAST(pysqlite_cursor_executemany), METH_FASTCALL, pysqlite_cursor_executemany__doc__}, | 
					
						
							| 
									
										
										
										
											2021-01-06 00:57:25 +01:00
										 |  |  | 
 | 
					
						
							|  |  |  | static PyObject * | 
					
						
							|  |  |  | pysqlite_cursor_executemany_impl(pysqlite_Cursor *self, PyObject *sql, | 
					
						
							|  |  |  |                                  PyObject *seq_of_parameters); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | static PyObject * | 
					
						
							| 
									
										
										
										
											2025-01-20 12:40:18 +01:00
										 |  |  | pysqlite_cursor_executemany(PyObject *self, PyObject *const *args, Py_ssize_t nargs) | 
					
						
							| 
									
										
										
										
											2021-01-06 00:57:25 +01:00
										 |  |  | { | 
					
						
							|  |  |  |     PyObject *return_value = NULL; | 
					
						
							|  |  |  |     PyObject *sql; | 
					
						
							|  |  |  |     PyObject *seq_of_parameters; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     if (!_PyArg_CheckPositional("executemany", nargs, 2, 2)) { | 
					
						
							|  |  |  |         goto exit; | 
					
						
							|  |  |  |     } | 
					
						
							|  |  |  |     if (!PyUnicode_Check(args[0])) { | 
					
						
							|  |  |  |         _PyArg_BadArgument("executemany", "argument 1", "str", args[0]); | 
					
						
							|  |  |  |         goto exit; | 
					
						
							|  |  |  |     } | 
					
						
							|  |  |  |     sql = args[0]; | 
					
						
							|  |  |  |     seq_of_parameters = args[1]; | 
					
						
							| 
									
										
										
										
											2025-01-20 12:40:18 +01:00
										 |  |  |     return_value = pysqlite_cursor_executemany_impl((pysqlite_Cursor *)self, sql, seq_of_parameters); | 
					
						
							| 
									
										
										
										
											2021-01-06 00:57:25 +01:00
										 |  |  | 
 | 
					
						
							|  |  |  | exit: | 
					
						
							|  |  |  |     return return_value; | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | PyDoc_STRVAR(pysqlite_cursor_executescript__doc__, | 
					
						
							|  |  |  | "executescript($self, sql_script, /)\n" | 
					
						
							|  |  |  | "--\n" | 
					
						
							|  |  |  | "\n" | 
					
						
							| 
									
										
										
										
											2022-03-08 05:18:41 +01:00
										 |  |  | "Executes multiple SQL statements at once."); | 
					
						
							| 
									
										
										
										
											2021-01-06 00:57:25 +01:00
										 |  |  | 
 | 
					
						
							|  |  |  | #define PYSQLITE_CURSOR_EXECUTESCRIPT_METHODDEF    \
 | 
					
						
							|  |  |  |     {"executescript", (PyCFunction)pysqlite_cursor_executescript, METH_O, pysqlite_cursor_executescript__doc__}, | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-08-08 08:49:44 +03:00
										 |  |  | static PyObject * | 
					
						
							|  |  |  | pysqlite_cursor_executescript_impl(pysqlite_Cursor *self, | 
					
						
							|  |  |  |                                    const char *sql_script); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | static PyObject * | 
					
						
							| 
									
										
										
										
											2025-01-20 12:40:18 +01:00
										 |  |  | pysqlite_cursor_executescript(PyObject *self, PyObject *arg) | 
					
						
							| 
									
										
										
										
											2021-08-08 08:49:44 +03:00
										 |  |  | { | 
					
						
							|  |  |  |     PyObject *return_value = NULL; | 
					
						
							|  |  |  |     const char *sql_script; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     if (!PyUnicode_Check(arg)) { | 
					
						
							|  |  |  |         _PyArg_BadArgument("executescript", "argument", "str", arg); | 
					
						
							|  |  |  |         goto exit; | 
					
						
							|  |  |  |     } | 
					
						
							| 
									
										
										
										
											2023-11-07 23:36:13 +01:00
										 |  |  |     Py_ssize_t sql_script_length; | 
					
						
							|  |  |  |     sql_script = PyUnicode_AsUTF8AndSize(arg, &sql_script_length); | 
					
						
							| 
									
										
										
										
											2021-08-08 08:49:44 +03:00
										 |  |  |     if (sql_script == NULL) { | 
					
						
							|  |  |  |         goto exit; | 
					
						
							|  |  |  |     } | 
					
						
							| 
									
										
										
										
											2023-11-07 23:36:13 +01:00
										 |  |  |     if (strlen(sql_script) != (size_t)sql_script_length) { | 
					
						
							|  |  |  |         PyErr_SetString(PyExc_ValueError, "embedded null character"); | 
					
						
							|  |  |  |         goto exit; | 
					
						
							|  |  |  |     } | 
					
						
							| 
									
										
										
										
											2025-01-20 12:40:18 +01:00
										 |  |  |     return_value = pysqlite_cursor_executescript_impl((pysqlite_Cursor *)self, sql_script); | 
					
						
							| 
									
										
										
										
											2021-08-08 08:49:44 +03:00
										 |  |  | 
 | 
					
						
							|  |  |  | exit: | 
					
						
							|  |  |  |     return return_value; | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-01-06 00:57:25 +01:00
										 |  |  | PyDoc_STRVAR(pysqlite_cursor_fetchone__doc__, | 
					
						
							|  |  |  | "fetchone($self, /)\n" | 
					
						
							|  |  |  | "--\n" | 
					
						
							|  |  |  | "\n" | 
					
						
							|  |  |  | "Fetches one row from the resultset."); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | #define PYSQLITE_CURSOR_FETCHONE_METHODDEF    \
 | 
					
						
							|  |  |  |     {"fetchone", (PyCFunction)pysqlite_cursor_fetchone, METH_NOARGS, pysqlite_cursor_fetchone__doc__}, | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | static PyObject * | 
					
						
							|  |  |  | pysqlite_cursor_fetchone_impl(pysqlite_Cursor *self); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | static PyObject * | 
					
						
							| 
									
										
										
										
											2025-01-20 12:40:18 +01:00
										 |  |  | pysqlite_cursor_fetchone(PyObject *self, PyObject *Py_UNUSED(ignored)) | 
					
						
							| 
									
										
										
										
											2021-01-06 00:57:25 +01:00
										 |  |  | { | 
					
						
							| 
									
										
										
										
											2025-01-20 12:40:18 +01:00
										 |  |  |     return pysqlite_cursor_fetchone_impl((pysqlite_Cursor *)self); | 
					
						
							| 
									
										
										
										
											2021-01-06 00:57:25 +01:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | PyDoc_STRVAR(pysqlite_cursor_fetchmany__doc__, | 
					
						
							| 
									
										
										
										
											2021-01-14 00:17:33 +01:00
										 |  |  | "fetchmany($self, /, size=1)\n" | 
					
						
							| 
									
										
										
										
											2021-01-06 00:57:25 +01:00
										 |  |  | "--\n" | 
					
						
							|  |  |  | "\n" | 
					
						
							| 
									
										
										
										
											2021-01-14 00:17:33 +01:00
										 |  |  | "Fetches several rows from the resultset.\n" | 
					
						
							|  |  |  | "\n" | 
					
						
							|  |  |  | "  size\n" | 
					
						
							|  |  |  | "    The default value is set by the Cursor.arraysize attribute."); | 
					
						
							| 
									
										
										
										
											2021-01-06 00:57:25 +01:00
										 |  |  | 
 | 
					
						
							|  |  |  | #define PYSQLITE_CURSOR_FETCHMANY_METHODDEF    \
 | 
					
						
							| 
									
										
										
										
											2022-05-03 20:25:41 +02:00
										 |  |  |     {"fetchmany", _PyCFunction_CAST(pysqlite_cursor_fetchmany), METH_FASTCALL|METH_KEYWORDS, pysqlite_cursor_fetchmany__doc__}, | 
					
						
							| 
									
										
										
										
											2021-01-06 00:57:25 +01:00
										 |  |  | 
 | 
					
						
							|  |  |  | static PyObject * | 
					
						
							|  |  |  | pysqlite_cursor_fetchmany_impl(pysqlite_Cursor *self, int maxrows); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | static PyObject * | 
					
						
							| 
									
										
										
										
											2025-01-20 12:40:18 +01:00
										 |  |  | pysqlite_cursor_fetchmany(PyObject *self, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) | 
					
						
							| 
									
										
										
										
											2021-01-06 00:57:25 +01:00
										 |  |  | { | 
					
						
							|  |  |  |     PyObject *return_value = NULL; | 
					
						
							| 
									
										
										
										
											2022-08-13 12:09:40 +02:00
										 |  |  |     #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
 | 
					
						
							| 
									
										
										
										
											2022-08-11 15:25:49 -06:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2022-08-13 12:09:40 +02:00
										 |  |  |     #define NUM_KEYWORDS 1
 | 
					
						
							| 
									
										
										
										
											2022-08-11 15:25:49 -06:00
										 |  |  |     static struct { | 
					
						
							|  |  |  |         PyGC_Head _this_is_not_used; | 
					
						
							|  |  |  |         PyObject_VAR_HEAD | 
					
						
							|  |  |  |         PyObject *ob_item[NUM_KEYWORDS]; | 
					
						
							|  |  |  |     } _kwtuple = { | 
					
						
							|  |  |  |         .ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS) | 
					
						
							|  |  |  |         .ob_item = { &_Py_ID(size), }, | 
					
						
							|  |  |  |     }; | 
					
						
							|  |  |  |     #undef NUM_KEYWORDS
 | 
					
						
							| 
									
										
										
										
											2022-08-13 12:09:40 +02:00
										 |  |  |     #define KWTUPLE (&_kwtuple.ob_base.ob_base)
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     #else  // !Py_BUILD_CORE
 | 
					
						
							|  |  |  |     #  define KWTUPLE NULL
 | 
					
						
							|  |  |  |     #endif  // !Py_BUILD_CORE
 | 
					
						
							| 
									
										
										
										
											2022-08-11 15:25:49 -06:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-01-06 00:57:25 +01:00
										 |  |  |     static const char * const _keywords[] = {"size", NULL}; | 
					
						
							| 
									
										
										
										
											2022-08-11 15:25:49 -06:00
										 |  |  |     static _PyArg_Parser _parser = { | 
					
						
							|  |  |  |         .keywords = _keywords, | 
					
						
							|  |  |  |         .fname = "fetchmany", | 
					
						
							|  |  |  |         .kwtuple = KWTUPLE, | 
					
						
							|  |  |  |     }; | 
					
						
							|  |  |  |     #undef KWTUPLE
 | 
					
						
							| 
									
										
										
										
											2021-01-06 00:57:25 +01:00
										 |  |  |     PyObject *argsbuf[1]; | 
					
						
							|  |  |  |     Py_ssize_t noptargs = nargs + (kwnames ? PyTuple_GET_SIZE(kwnames) : 0) - 0; | 
					
						
							| 
									
										
										
										
											2025-01-20 12:40:18 +01:00
										 |  |  |     int maxrows = ((pysqlite_Cursor *)self)->arraysize; | 
					
						
							| 
									
										
										
										
											2021-01-06 00:57:25 +01:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-11-08 14:23:50 +02:00
										 |  |  |     args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, | 
					
						
							|  |  |  |             /*minpos*/ 0, /*maxpos*/ 1, /*minkw*/ 0, /*varpos*/ 0, argsbuf); | 
					
						
							| 
									
										
										
										
											2021-01-06 00:57:25 +01:00
										 |  |  |     if (!args) { | 
					
						
							|  |  |  |         goto exit; | 
					
						
							|  |  |  |     } | 
					
						
							|  |  |  |     if (!noptargs) { | 
					
						
							|  |  |  |         goto skip_optional_pos; | 
					
						
							|  |  |  |     } | 
					
						
							| 
									
										
										
										
											2023-08-25 00:51:22 +02:00
										 |  |  |     maxrows = PyLong_AsInt(args[0]); | 
					
						
							| 
									
										
										
										
											2021-01-06 00:57:25 +01:00
										 |  |  |     if (maxrows == -1 && PyErr_Occurred()) { | 
					
						
							|  |  |  |         goto exit; | 
					
						
							|  |  |  |     } | 
					
						
							|  |  |  | skip_optional_pos: | 
					
						
							| 
									
										
										
										
											2025-01-20 12:40:18 +01:00
										 |  |  |     return_value = pysqlite_cursor_fetchmany_impl((pysqlite_Cursor *)self, maxrows); | 
					
						
							| 
									
										
										
										
											2021-01-06 00:57:25 +01:00
										 |  |  | 
 | 
					
						
							|  |  |  | exit: | 
					
						
							|  |  |  |     return return_value; | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | PyDoc_STRVAR(pysqlite_cursor_fetchall__doc__, | 
					
						
							|  |  |  | "fetchall($self, /)\n" | 
					
						
							|  |  |  | "--\n" | 
					
						
							|  |  |  | "\n" | 
					
						
							|  |  |  | "Fetches all rows from the resultset."); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | #define PYSQLITE_CURSOR_FETCHALL_METHODDEF    \
 | 
					
						
							|  |  |  |     {"fetchall", (PyCFunction)pysqlite_cursor_fetchall, METH_NOARGS, pysqlite_cursor_fetchall__doc__}, | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | static PyObject * | 
					
						
							|  |  |  | pysqlite_cursor_fetchall_impl(pysqlite_Cursor *self); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | static PyObject * | 
					
						
							| 
									
										
										
										
											2025-01-20 12:40:18 +01:00
										 |  |  | pysqlite_cursor_fetchall(PyObject *self, PyObject *Py_UNUSED(ignored)) | 
					
						
							| 
									
										
										
										
											2021-01-06 00:57:25 +01:00
										 |  |  | { | 
					
						
							| 
									
										
										
										
											2025-01-20 12:40:18 +01:00
										 |  |  |     return pysqlite_cursor_fetchall_impl((pysqlite_Cursor *)self); | 
					
						
							| 
									
										
										
										
											2021-01-06 00:57:25 +01:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | PyDoc_STRVAR(pysqlite_cursor_setinputsizes__doc__, | 
					
						
							|  |  |  | "setinputsizes($self, sizes, /)\n" | 
					
						
							|  |  |  | "--\n" | 
					
						
							|  |  |  | "\n" | 
					
						
							| 
									
										
										
										
											2022-03-09 03:45:48 +01:00
										 |  |  | "Required by DB-API. Does nothing in sqlite3."); | 
					
						
							| 
									
										
										
										
											2021-01-06 00:57:25 +01:00
										 |  |  | 
 | 
					
						
							|  |  |  | #define PYSQLITE_CURSOR_SETINPUTSIZES_METHODDEF    \
 | 
					
						
							|  |  |  |     {"setinputsizes", (PyCFunction)pysqlite_cursor_setinputsizes, METH_O, pysqlite_cursor_setinputsizes__doc__}, | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2025-03-11 16:33:36 +01:00
										 |  |  | static PyObject * | 
					
						
							|  |  |  | pysqlite_cursor_setinputsizes_impl(pysqlite_Cursor *self, PyObject *sizes); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | static PyObject * | 
					
						
							|  |  |  | pysqlite_cursor_setinputsizes(PyObject *self, PyObject *sizes) | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  |     PyObject *return_value = NULL; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     return_value = pysqlite_cursor_setinputsizes_impl((pysqlite_Cursor *)self, sizes); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     return return_value; | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-01-06 00:57:25 +01:00
										 |  |  | PyDoc_STRVAR(pysqlite_cursor_setoutputsize__doc__, | 
					
						
							|  |  |  | "setoutputsize($self, size, column=None, /)\n" | 
					
						
							|  |  |  | "--\n" | 
					
						
							|  |  |  | "\n" | 
					
						
							| 
									
										
										
										
											2022-03-09 03:45:48 +01:00
										 |  |  | "Required by DB-API. Does nothing in sqlite3."); | 
					
						
							| 
									
										
										
										
											2021-01-06 00:57:25 +01:00
										 |  |  | 
 | 
					
						
							|  |  |  | #define PYSQLITE_CURSOR_SETOUTPUTSIZE_METHODDEF    \
 | 
					
						
							| 
									
										
										
										
											2022-05-03 20:25:41 +02:00
										 |  |  |     {"setoutputsize", _PyCFunction_CAST(pysqlite_cursor_setoutputsize), METH_FASTCALL, pysqlite_cursor_setoutputsize__doc__}, | 
					
						
							| 
									
										
										
										
											2021-01-06 00:57:25 +01:00
										 |  |  | 
 | 
					
						
							|  |  |  | static PyObject * | 
					
						
							|  |  |  | pysqlite_cursor_setoutputsize_impl(pysqlite_Cursor *self, PyObject *size, | 
					
						
							|  |  |  |                                    PyObject *column); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | static PyObject * | 
					
						
							| 
									
										
										
										
											2025-01-20 12:40:18 +01:00
										 |  |  | pysqlite_cursor_setoutputsize(PyObject *self, PyObject *const *args, Py_ssize_t nargs) | 
					
						
							| 
									
										
										
										
											2021-01-06 00:57:25 +01:00
										 |  |  | { | 
					
						
							|  |  |  |     PyObject *return_value = NULL; | 
					
						
							|  |  |  |     PyObject *size; | 
					
						
							|  |  |  |     PyObject *column = Py_None; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     if (!_PyArg_CheckPositional("setoutputsize", nargs, 1, 2)) { | 
					
						
							|  |  |  |         goto exit; | 
					
						
							|  |  |  |     } | 
					
						
							|  |  |  |     size = args[0]; | 
					
						
							|  |  |  |     if (nargs < 2) { | 
					
						
							|  |  |  |         goto skip_optional; | 
					
						
							|  |  |  |     } | 
					
						
							|  |  |  |     column = args[1]; | 
					
						
							|  |  |  | skip_optional: | 
					
						
							| 
									
										
										
										
											2025-01-20 12:40:18 +01:00
										 |  |  |     return_value = pysqlite_cursor_setoutputsize_impl((pysqlite_Cursor *)self, size, column); | 
					
						
							| 
									
										
										
										
											2021-01-06 00:57:25 +01:00
										 |  |  | 
 | 
					
						
							|  |  |  | exit: | 
					
						
							|  |  |  |     return return_value; | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | PyDoc_STRVAR(pysqlite_cursor_close__doc__, | 
					
						
							|  |  |  | "close($self, /)\n" | 
					
						
							|  |  |  | "--\n" | 
					
						
							|  |  |  | "\n" | 
					
						
							|  |  |  | "Closes the cursor."); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | #define PYSQLITE_CURSOR_CLOSE_METHODDEF    \
 | 
					
						
							| 
									
										
										
										
											2021-10-27 13:12:21 +02:00
										 |  |  |     {"close", (PyCFunction)pysqlite_cursor_close, METH_NOARGS, pysqlite_cursor_close__doc__}, | 
					
						
							| 
									
										
										
										
											2021-01-06 00:57:25 +01:00
										 |  |  | 
 | 
					
						
							|  |  |  | static PyObject * | 
					
						
							| 
									
										
										
										
											2021-10-27 13:12:21 +02:00
										 |  |  | pysqlite_cursor_close_impl(pysqlite_Cursor *self); | 
					
						
							| 
									
										
										
										
											2021-01-06 00:57:25 +01:00
										 |  |  | 
 | 
					
						
							|  |  |  | static PyObject * | 
					
						
							| 
									
										
										
										
											2025-01-20 12:40:18 +01:00
										 |  |  | pysqlite_cursor_close(PyObject *self, PyObject *Py_UNUSED(ignored)) | 
					
						
							| 
									
										
										
										
											2021-01-06 00:57:25 +01:00
										 |  |  | { | 
					
						
							| 
									
										
										
										
											2025-01-20 12:40:18 +01:00
										 |  |  |     return pysqlite_cursor_close_impl((pysqlite_Cursor *)self); | 
					
						
							| 
									
										
										
										
											2021-01-06 00:57:25 +01:00
										 |  |  | } | 
					
						
							| 
									
										
										
										
											2025-03-11 16:33:36 +01:00
										 |  |  | /*[clinic end generated code: output=02831aed7377f5f6 input=a9049054013a1b77]*/ |