import sqlite3

con = sqlite3.connect(":memory:", autocommit=False)
try:
    with con:
        con.execute("CREATE TABLE notes (body TEXT NOT NULL)")
        con.executemany("INSERT INTO notes VALUES (?)", [("Sam's note",), ("Another note",)])
    search = "Sam's note"
    rows = con.execute("SELECT body FROM notes WHERE body = ?", (search,)).fetchall()
    print(rows)
finally:
    con.close()
