blob: 92b5ad60cb5791908227b7d217bf8c7936b58a5b (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
|
import sqlite3
con = sqlite3.connect(":memory:")
con.row_factory = sqlite3.Row
cur = con.cursor()
cur.execute("select 'John' as name, 42 as age")
for row in cur:
assert row[0] == row["name"]
assert row["name"] == row["nAmE"]
assert row[1] == row["age"]
assert row[1] == row["AgE"]
|