summaryrefslogtreecommitdiffstats
path: root/Doc/includes/sqlite3/parse_colnames.py
diff options
context:
space:
mode:
Diffstat (limited to 'Doc/includes/sqlite3/parse_colnames.py')
-rw-r--r--Doc/includes/sqlite3/parse_colnames.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/Doc/includes/sqlite3/parse_colnames.py b/Doc/includes/sqlite3/parse_colnames.py
new file mode 100644
index 0000000..cc68c76
--- /dev/null
+++ b/Doc/includes/sqlite3/parse_colnames.py
@@ -0,0 +1,8 @@
+import sqlite3
+import datetime
+
+con = sqlite3.connect(":memory:", detect_types=sqlite3.PARSE_COLNAMES)
+cur = con.cursor()
+cur.execute('select ? as "x [timestamp]"', (datetime.datetime.now(),))
+dt = cur.fetchone()[0]
+print(dt, type(dt))