summaryrefslogtreecommitdiff
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..702fa8d
--- /dev/null
+++ b/doc/includes/sqlite3/parse_colnames.py
@@ -0,0 +1,8 @@
+from pysqlite2 import dbapi2 as 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)