view Doc/includes/sqlite3/rowclass.py @ 64166:d0e9febfa00a 3.1

Merged revisions 84172 via svnmerge from svn+ssh://pythondev@svn.python.org/python/branches/py3k ........ r84172 | martin.v.loewis | 2010-08-18 18:12:23 +0200 (Mi, 18 Aug 2010) | 2 lines Restore GIL in nis_cat in case of error. ........
author Martin v. Löwis <martin@v.loewis.de>
date Thu, 19 Aug 2010 09:03:03 +0000
parents 9e1529bf0442
children 9eb77d455be1
line wrap: on
line source

import sqlite3

con = sqlite3.connect("mydb")
con.row_factory = sqlite3.Row

cur = con.cursor()
cur.execute("select name_last, age from people")
for row in cur:
    assert row[0] == row["name_last"]
    assert row["name_last"] == row["nAmE_lAsT"]
    assert row[1] == row["age"]
    assert row[1] == row["AgE"]