2007-08-15 11:28:22 -03:00
|
|
|
import sqlite3
|
|
|
|
|
2012-02-15 16:17:21 -04:00
|
|
|
con = sqlite3.connect(":memory:")
|
2007-08-15 11:28:22 -03:00
|
|
|
con.row_factory = sqlite3.Row
|
|
|
|
|
|
|
|
cur = con.cursor()
|
2012-02-15 16:17:21 -04:00
|
|
|
cur.execute("select 'John' as name, 42 as age")
|
2007-08-15 11:28:22 -03:00
|
|
|
for row in cur:
|
2012-02-15 16:17:21 -04:00
|
|
|
assert row[0] == row["name"]
|
|
|
|
assert row["name"] == row["nAmE"]
|
2007-08-15 11:28:22 -03:00
|
|
|
assert row[1] == row["age"]
|
|
|
|
assert row[1] == row["AgE"]
|