blob: 92b5ad60cb5791908227b7d217bf8c7936b58a5b [file] [log] [blame]
Georg Brandl8ec7f652007-08-15 14:28:01 +00001import sqlite3
2
Petri Lehtinena15a8d22012-03-01 21:28:00 +02003con = sqlite3.connect(":memory:")
Georg Brandl8ec7f652007-08-15 14:28:01 +00004con.row_factory = sqlite3.Row
5
6cur = con.cursor()
Petri Lehtinena15a8d22012-03-01 21:28:00 +02007cur.execute("select 'John' as name, 42 as age")
Georg Brandl8ec7f652007-08-15 14:28:01 +00008for row in cur:
Petri Lehtinena15a8d22012-03-01 21:28:00 +02009 assert row[0] == row["name"]
10 assert row["name"] == row["nAmE"]
Georg Brandl8ec7f652007-08-15 14:28:01 +000011 assert row[1] == row["age"]
12 assert row[1] == row["AgE"]