require 'sqlite'
db = SQLite::Database.new("library.db")
db.execute("select title,author from books") do |row|
  p row
end
db.close

# Output:
# ["The Case for Mars", "Robert Zubrin"]
# ["Democracy in America", "Alexis de Tocqueville"]
# ...

