Mercurial > cpython-lru_cache-weakref
annotate Doc/lib/sqlite3/rowclass.py @ 39042:c02fa187e0f4 legacy-trunk
Part of SF patch #1484695. This removes dead code. The chksum was
already verified in .frombuf() on the lines above. If there was
a problem an exception is raised, so there was no way this condition
could have been true.
| author | Neal Norwitz <nnorwitz@gmail.com> |
|---|---|
| date | Mon, 10 Jul 2006 00:23:17 +0000 |
| parents | cf19a123a5d9 |
| children |
| rev | line source |
|---|---|
|
38069
cf19a123a5d9
Further integration of the documentation for the sqlite3 module. There's still
Gerhard Häring <gh@ghaering.de>
parents:
diff
changeset
|
1 import sqlite3 |
|
cf19a123a5d9
Further integration of the documentation for the sqlite3 module. There's still
Gerhard Häring <gh@ghaering.de>
parents:
diff
changeset
|
2 |
|
cf19a123a5d9
Further integration of the documentation for the sqlite3 module. There's still
Gerhard Häring <gh@ghaering.de>
parents:
diff
changeset
|
3 con = sqlite3.connect("mydb") |
|
cf19a123a5d9
Further integration of the documentation for the sqlite3 module. There's still
Gerhard Häring <gh@ghaering.de>
parents:
diff
changeset
|
4 con.row_factory = sqlite3.Row |
|
cf19a123a5d9
Further integration of the documentation for the sqlite3 module. There's still
Gerhard Häring <gh@ghaering.de>
parents:
diff
changeset
|
5 |
|
cf19a123a5d9
Further integration of the documentation for the sqlite3 module. There's still
Gerhard Häring <gh@ghaering.de>
parents:
diff
changeset
|
6 cur = con.cursor() |
|
cf19a123a5d9
Further integration of the documentation for the sqlite3 module. There's still
Gerhard Häring <gh@ghaering.de>
parents:
diff
changeset
|
7 cur.execute("select name_last, age from people") |
|
cf19a123a5d9
Further integration of the documentation for the sqlite3 module. There's still
Gerhard Häring <gh@ghaering.de>
parents:
diff
changeset
|
8 for row in cur: |
|
cf19a123a5d9
Further integration of the documentation for the sqlite3 module. There's still
Gerhard Häring <gh@ghaering.de>
parents:
diff
changeset
|
9 assert row[0] == row["name_last"] |
|
cf19a123a5d9
Further integration of the documentation for the sqlite3 module. There's still
Gerhard Häring <gh@ghaering.de>
parents:
diff
changeset
|
10 assert row["name_last"] == row["nAmE_lAsT"] |
|
cf19a123a5d9
Further integration of the documentation for the sqlite3 module. There's still
Gerhard Häring <gh@ghaering.de>
parents:
diff
changeset
|
11 assert row[1] == row["age"] |
|
cf19a123a5d9
Further integration of the documentation for the sqlite3 module. There's still
Gerhard Häring <gh@ghaering.de>
parents:
diff
changeset
|
12 assert row[1] == row["AgE"] |
