PageRenderTime 363ms CodeModel.GetById 202ms app.highlight 1ms RepoModel.GetById 160ms app.codeStats 0ms

/Doc/includes/sqlite3/parse_colnames.py

http://unladen-swallow.googlecode.com/
Python | 8 lines | 7 code | 1 blank | 0 comment | 0 complexity | 681833372f9c072fcf6fe83be0021dcc MD5 | raw file
1import sqlite3
2import datetime
3
4con = sqlite3.connect(":memory:", detect_types=sqlite3.PARSE_COLNAMES)
5cur = con.cursor()
6cur.execute('select ? as "x [timestamp]"', (datetime.datetime.now(),))
7dt = cur.fetchone()[0]
8print dt, type(dt)