diff options
| author | Erlend Egeberg Aasland <erlend.aasland@protonmail.com> | 2022-06-25 22:06:06 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-06-25 22:06:06 +0200 |
| commit | bd3c1c187e0e4fde5aec6835d180e9eddde8ceb6 (patch) | |
| tree | 8030a0312783066d3cfeaae482bc3755b5dff9fe /Modules/_sqlite | |
| parent | bec802dbb87717a23acb9c600c15f40bc98340a3 (diff) | |
| download | cpython-git-bd3c1c187e0e4fde5aec6835d180e9eddde8ceb6.tar.gz | |
gh-90016: Reword sqlite3 adapter/converter docs (#93095)
Also add adapters and converter recipes.
Co-authored-by: CAM Gerlach <CAM.Gerlach@Gerlach.CAM>
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com
Diffstat (limited to 'Modules/_sqlite')
| -rw-r--r-- | Modules/_sqlite/clinic/module.c.h | 10 | ||||
| -rw-r--r-- | Modules/_sqlite/module.c | 12 |
2 files changed, 11 insertions, 11 deletions
diff --git a/Modules/_sqlite/clinic/module.c.h b/Modules/_sqlite/clinic/module.c.h index d3367cf62b..ef0dd4d1c1 100644 --- a/Modules/_sqlite/clinic/module.c.h +++ b/Modules/_sqlite/clinic/module.c.h @@ -157,10 +157,10 @@ exit: } PyDoc_STRVAR(pysqlite_register_adapter__doc__, -"register_adapter($module, type, caster, /)\n" +"register_adapter($module, type, adapter, /)\n" "--\n" "\n" -"Registers an adapter with sqlite3\'s adapter registry."); +"Register a function to adapt Python objects to SQLite values."); #define PYSQLITE_REGISTER_ADAPTER_METHODDEF \ {"register_adapter", _PyCFunction_CAST(pysqlite_register_adapter), METH_FASTCALL, pysqlite_register_adapter__doc__}, @@ -188,10 +188,10 @@ exit: } PyDoc_STRVAR(pysqlite_register_converter__doc__, -"register_converter($module, name, converter, /)\n" +"register_converter($module, typename, converter, /)\n" "--\n" "\n" -"Registers a converter with sqlite3."); +"Register a function to convert SQLite values to Python objects."); #define PYSQLITE_REGISTER_CONVERTER_METHODDEF \ {"register_converter", _PyCFunction_CAST(pysqlite_register_converter), METH_FASTCALL, pysqlite_register_converter__doc__}, @@ -292,4 +292,4 @@ skip_optional: exit: return return_value; } -/*[clinic end generated code: output=a7cfa6dc9d54273c input=a9049054013a1b77]*/ +/*[clinic end generated code: output=9ac18606b0eaec03 input=a9049054013a1b77]*/ diff --git a/Modules/_sqlite/module.c b/Modules/_sqlite/module.c index dfb9301538..eca25b94a4 100644 --- a/Modules/_sqlite/module.c +++ b/Modules/_sqlite/module.c @@ -108,16 +108,16 @@ pysqlite_complete_statement_impl(PyObject *module, const char *statement) _sqlite3.register_adapter as pysqlite_register_adapter type: object(type='PyTypeObject *') - caster: object + adapter as caster: object / -Registers an adapter with sqlite3's adapter registry. +Register a function to adapt Python objects to SQLite values. [clinic start generated code]*/ static PyObject * pysqlite_register_adapter_impl(PyObject *module, PyTypeObject *type, PyObject *caster) -/*[clinic end generated code: output=a287e8db18e8af23 input=b4bd87afcadc535d]*/ +/*[clinic end generated code: output=a287e8db18e8af23 input=29a5e0f213030242]*/ { int rc; @@ -142,17 +142,17 @@ pysqlite_register_adapter_impl(PyObject *module, PyTypeObject *type, /*[clinic input] _sqlite3.register_converter as pysqlite_register_converter - name as orig_name: unicode + typename as orig_name: unicode converter as callable: object / -Registers a converter with sqlite3. +Register a function to convert SQLite values to Python objects. [clinic start generated code]*/ static PyObject * pysqlite_register_converter_impl(PyObject *module, PyObject *orig_name, PyObject *callable) -/*[clinic end generated code: output=a2f2bfeed7230062 input=90f645419425d6c4]*/ +/*[clinic end generated code: output=a2f2bfeed7230062 input=159a444971b40378]*/ { PyObject* name = NULL; PyObject* retval = NULL; |
