mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
[3.11] gh-90016: Reword sqlite3 adapter/converter docs (GH-93095) (#94272)
Also add adapters and converter recipes.
Co-authored-by: CAM Gerlach <CAM.Gerlach@Gerlach.CAM>
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com.
(cherry picked from commit bd3c1c187e
)
This commit is contained in:
parent
125146771c
commit
0a1517dc41
5 changed files with 156 additions and 122 deletions
|
@ -138,16 +138,16 @@ pysqlite_enable_shared_cache_impl(PyObject *module, int do_enable)
|
|||
_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;
|
||||
|
||||
|
@ -172,17 +172,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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue