ยปCore Development>Code coverage>Doc/includes/sqlite3/shortcut_methods.py

Python code coverage for Doc/includes/sqlite3/shortcut_methods.py

#countcontent
1n/aimport sqlite3
2n/a
3n/apersons = [
4n/a ("Hugo", "Boss"),
5n/a ("Calvin", "Klein")
6n/a ]
7n/a
8n/acon = sqlite3.connect(":memory:")
9n/a
10n/a# Create the table
11n/acon.execute("create table person(firstname, lastname)")
12n/a
13n/a# Fill the table
14n/acon.executemany("insert into person(firstname, lastname) values (?, ?)", persons)
15n/a
16n/a# Print the table contents
17n/afor row in con.execute("select firstname, lastname from person"):
18n/a print(row)
19n/a
20n/aprint("I just deleted", con.execute("delete from person").rowcount, "rows")