kopia lustrzana https://github.com/micropython/micropython-lib
13 wiersze
275 B
Python
13 wiersze
275 B
Python
![]() |
import sqlite3
|
||
|
|
||
|
|
||
|
conn = sqlite3.connect(":memory:")
|
||
|
|
||
|
cur = conn.cursor()
|
||
|
cur.execute("CREATE TABLE foo(a int)")
|
||
|
cur.execute("INSERT INTO foo VALUES (42)")
|
||
|
assert cur.lastrowid == 1
|
||
|
cur.execute("SELECT * FROM foo")
|
||
|
assert cur.fetchone() == (42,)
|
||
|
assert cur.fetchone() is None
|