Skip to content

Instantly share code, notes, and snippets.

@radar
Created July 7, 2014 04:11
Show Gist options
  • Save radar/d1054b173f73979feb5f to your computer and use it in GitHub Desktop.
Save radar/d1054b173f73979feb5f to your computer and use it in GitHub Desktop.
require 'sequel'
require 'pg'
DB1 = Sequel.connect('postgres://localhost/database_1')
DB2 = Sequel.connect('postgres://localhost/database_2')
DB1[:people].where(:whatever => "something").each do |person|
DB2[:people].insert(:name => person.name)
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment