Skip to content
Merged
Changes from 1 commit
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
598e26a
gh-90016: Reword sqlite3 adapter/converter docs
erlend-aasland May 23, 2022
e5b1b88
Add current adapters/converter as recipes: improve this
erlend-aasland May 23, 2022
9399b54
default role
erlend-aasland May 23, 2022
40bb59a
Formatting
erlend-aasland May 23, 2022
82cf3e2
Address Serhiy's review
erlend-aasland May 23, 2022
0b6f381
Address Alex' review
erlend-aasland May 25, 2022
c4dde48
Nit
erlend-aasland May 25, 2022
72013ef
Address Alex' nitpicks
erlend-aasland May 25, 2022
3c70d52
Address in-house review
erlend-aasland May 25, 2022
681baad
Recipes, take 1
erlend-aasland May 25, 2022
bf4cb1f
Docstring wording
erlend-aasland May 25, 2022
2d1a0c1
Update Doc/library/sqlite3.rst
Jun 22, 2022
94308ff
Update Doc/library/sqlite3.rst
Jun 22, 2022
06657f2
Update Doc/library/sqlite3.rst
Jun 22, 2022
b98e363
Update Doc/library/sqlite3.rst
Jun 22, 2022
97812bb
Update Doc/library/sqlite3.rst
Jun 22, 2022
d3dd5a2
Update Doc/library/sqlite3.rst
Jun 22, 2022
f381b65
Update Doc/library/sqlite3.rst
Jun 22, 2022
65eb45c
Update Doc/library/sqlite3.rst
Jun 22, 2022
172c7d9
Update Doc/library/sqlite3.rst
Jun 22, 2022
5ac2af9
Update Doc/library/sqlite3.rst
Jun 22, 2022
433bf5a
Update Doc/library/sqlite3.rst
Jun 22, 2022
f7646de
Update Doc/library/sqlite3.rst
Jun 22, 2022
6fbcff8
Assuming direct control
Jun 22, 2022
b319b54
Address the last part of CAM's review
erlend-aasland Jun 23, 2022
4e3b8fd
Merge branch 'main' into sqlite-doc-converters
erlend-aasland Jun 23, 2022
e821a7e
Clarify parse column names further
erlend-aasland Jun 23, 2022
bc295d8
Revert unneeded change
erlend-aasland Jun 23, 2022
9235f8d
Further clarify register_converter
erlend-aasland Jun 23, 2022
8484164
Use testsetup/doctest
erlend-aasland Jun 23, 2022
b579f67
Revert "Use testsetup/doctest"
erlend-aasland Jun 23, 2022
0e42fa6
Update Doc/library/sqlite3.rst
Jun 24, 2022
8d97fcb
Reflow
erlend-aasland Jun 25, 2022
d300b33
Merge remote-tracking branch 'upstream/main' into sqlite-doc-converters
erlend-aasland Jun 25, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Formatting
  • Loading branch information
erlend-aasland committed May 23, 2022
commit 40bb59a20f749ee9623a33845dd9c321ae4f36e2
12 changes: 8 additions & 4 deletions Doc/library/sqlite3.rst
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,7 @@ Module functions and constants
The following SQL code results in the following lookups:
Comment thread
erlend-aasland marked this conversation as resolved.
Outdated

.. code-block:: sql

CREATE TABLE test(
i integer primary key, ! will look up a converter named "integer"
p point, ! will look up a converter named "point"
Expand All @@ -226,6 +227,7 @@ Module functions and constants
dictionary key.

.. code-block:: sql

SELECT p as "p [point]" FROM test; ! will look up converter "point"

This flag may be paired with :const:`PARSE_DECLTYPES` using the ``|``
Expand Down Expand Up @@ -1333,6 +1335,8 @@ This section shows recipes for common adapters and converters.

.. testcode::

import sqlite3

# Timezone naive datetime adapters and converters.
Comment thread
erlend-aasland marked this conversation as resolved.
Outdated
def adapt_date(val):
return val.isoformat()
Expand All @@ -1356,10 +1360,10 @@ This section shows recipes for common adapters and converters.
val = datetime.datetime(year, month, day, hours, minutes, seconds, microseconds)
return val

register_adapter(datetime.date, adapt_date)
register_adapter(datetime.datetime, adapt_datetime)
register_converter("date", convert_date)
register_converter("timestamp", convert_timestamp)
sqlite3.register_adapter(datetime.date, adapt_date)
sqlite3.register_adapter(datetime.datetime, adapt_datetime)
sqlite3.register_converter("date", convert_date)
sqlite3.register_converter("timestamp", convert_timestamp)


.. _sqlite3-controlling-transactions:
Expand Down