#lang scheme

(require (prefix-in sqlite3: (planet jaymccarthy/sqlite:3)))

(let ((db (sqlite3:open ':memory:)))
  (sqlite3:exec/ignore db "CREATE TABLE foo (id INTEGER PRIMARY KEY, bar INTEGER, baz TEXT);")
  (let ((insert-statement (sqlite3:prepare db "INSERT INTO foo (bar,baz) VALUES (?,?);")))
    (sqlite3:run insert-statement 2 "two")
    (sqlite3:reset insert-statement) ; eww
    (display "Hmm..\n")
    (sqlite3:run insert-statement 3 "three")
    (display "HMM..\n")
    (sqlite3:finalize insert-statement)) ; ewwww
    (sqlite3:close db))