Skip to content

Instantly share code, notes, and snippets.

@apeckham
Created October 13, 2011 22:24
Show Gist options
  • Save apeckham/1285724 to your computer and use it in GitHub Desktop.
Save apeckham/1285724 to your computer and use it in GitHub Desktop.
require 'uri'
uri = URI.parse(ARGV[0])
exec "psql 'user=#{uri.user} password=#{uri.password} host=#{uri.host} dbname=#{uri.path[1..-1]}'"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment