Skip to content

Instantly share code, notes, and snippets.

@ishikawa
Created July 29, 2008 00:41
Show Gist options
  • Select an option

  • Save ishikawa/2986 to your computer and use it in GitHub Desktop.

Select an option

Save ishikawa/2986 to your computer and use it in GitHub Desktop.
SQLite INSERT or REPLACE
stmt = dbm.prepare "INSERT OR REPLACE INTO items VALUES ( ?, ?, ? );"
begin
items.each do |item|
stmt.execute(*item)
end
ensure
stmt.close rescue nil
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment