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 /Doc/includes/sqlite3/adapter_datetime.py | |
parent | bec802dbb87717a23acb9c600c15f40bc98340a3 (diff) | |
download | cpython-bd3c1c187e0e4fde5aec6835d180e9eddde8ceb6.tar.gz cpython-bd3c1c187e0e4fde5aec6835d180e9eddde8ceb6.zip |
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 'Doc/includes/sqlite3/adapter_datetime.py')
-rw-r--r-- | Doc/includes/sqlite3/adapter_datetime.py | 17 |
1 files changed, 0 insertions, 17 deletions
diff --git a/Doc/includes/sqlite3/adapter_datetime.py b/Doc/includes/sqlite3/adapter_datetime.py deleted file mode 100644 index d5221d80c35..00000000000 --- a/Doc/includes/sqlite3/adapter_datetime.py +++ /dev/null @@ -1,17 +0,0 @@ -import sqlite3 -import datetime -import time - -def adapt_datetime(ts): - return time.mktime(ts.timetuple()) - -sqlite3.register_adapter(datetime.datetime, adapt_datetime) - -con = sqlite3.connect(":memory:") -cur = con.cursor() - -now = datetime.datetime.now() -cur.execute("select ?", (now,)) -print(cur.fetchone()[0]) - -con.close() |