local apr = require 'apr'
local database = apr.dbd 'sqlite3'
assert(database:open ':memory:')
assert(database:query 'create table example (id integer, name text)')
assert(database:query 'insert into example VALUES (1, "test")')
local query = assert(database:prepare 'select * from example where name = %s')
local results = assert(query:select(false, 'test'))
local example = assert(results:row())
table.foreach(example, print)
assert(example.id == '1' and example.name == 'test')
