blob: fc60287069a854de0b0b72329206f976e5f647a5 [file] [log] [blame]
Georg Brandl116aa622007-08-15 14:28:22 +00001import sqlite3
2
Petri Lehtinen1ca93952012-02-15 22:17:21 +02003con = sqlite3.connect(":memory:")
Georg Brandl116aa622007-08-15 14:28:22 +00004con.row_factory = sqlite3.Row
5
6cur = con.cursor()
Petri Lehtinen1ca93952012-02-15 22:17:21 +02007cur.execute("select 'John' as name, 42 as age")
Georg Brandl116aa622007-08-15 14:28:22 +00008for row in cur:
Petri Lehtinen1ca93952012-02-15 22:17:21 +02009 assert row[0] == row["name"]
10 assert row["name"] == row["nAmE"]
Georg Brandl116aa622007-08-15 14:28:22 +000011 assert row[1] == row["age"]
12 assert row[1] == row["AgE"]
Miss Islington (bot)205c1f02019-05-19 15:36:32 -070013
14con.close()