lib/pgslice/helpers.rb in pgslice-0.4.7 vs lib/pgslice/helpers.rb in pgslice-0.4.8
- old
+ new
@@ -31,10 +31,10 @@
uri = URI.parse(url)
params = CGI.parse(uri.query.to_s)
# remove schema
@schema = Array(params.delete("schema") || "public")[0]
- uri.query = URI.encode_www_form(params)
+ uri.query = params.any? ? URI.encode_www_form(params) : nil
ENV["PGCONNECT_TIMEOUT"] ||= "1"
conn = PG::Connection.new(uri.to_s)
conn.set_notice_processor do |message|
say message