PageRenderTime 37ms CodeModel.GetById 29ms app.highlight 5ms RepoModel.GetById 1ms app.codeStats 0ms

/Doc/includes/sqlite3/rowclass.py

http://unladen-swallow.googlecode.com/
Python | 12 lines | 10 code | 2 blank | 0 comment | 2 complexity | e7cda939cd654a4582d354ba0a539202 MD5 | raw file
 1import sqlite3
 2
 3con = sqlite3.connect("mydb")
 4con.row_factory = sqlite3.Row
 5
 6cur = con.cursor()
 7cur.execute("select name_last, age from people")
 8for row in cur:
 9    assert row[0] == row["name_last"]
10    assert row["name_last"] == row["nAmE_lAsT"]
11    assert row[1] == row["age"]
12    assert row[1] == row["AgE"]