Created
September 28, 2010 06:01
-
-
Save paddor/600490 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
warn "Opening database connection ..." | |
DB = Sequel.postgres(:host=>'localhost', :user=>'logs', :database=>'logs') | |
warn "Running COPY command with data ..." | |
DB.run copy_command | |
DB.synchronize do |conn| | |
ret = conn.put_copy_data(copy_data) # or raise "could not send COPY data" | |
warn "Sent COPY data: #{ret}" | |
ret = conn.put_copy_end # or raise "could not send COPY end" | |
warn "Sent COPY end: #{ret}" | |
end | |
DB.disconnect |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment