Skip to content

Instantly share code, notes, and snippets.

@campanalbero
Created September 17, 2014 19:11
Show Gist options
  • Save campanalbero/2d35e22721e14f762159 to your computer and use it in GitHub Desktop.
Save campanalbero/2d35e22721e14f762159 to your computer and use it in GitHub Desktop.
sequel で insert / delete
require 'rubygems'
require 'sequel'
require 'pp'
DB = Sequel.sqlite('photo.db')
failures = DB[:failure]
# insert into failure (path) values ('/path/to/photo.file');
failures.insert(:path => '/path/to/photo.file')
# delete from failure where path = '/path/to/photo.file';
failures.where('path = ?', '/path/to/photo.file').delete
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment