You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

12 lines
299 B

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