title: How to use connection string with sequel for postgresql
body: <p>I wanted to connect to postgresql database using connection string in form of</p>
  
  <pre><code>host=localhost user=x password=y dbname=z
  </code></pre>
  
  <p>this works fine when passed to psql</p>
  
  <pre><code>$ psql "host=localhost user=x password=y dbname=z"
  </code></pre>
  
  <p>and when passed to the <code>PG</code> gem</p>
  
  <pre><code>&gt; PG.connect("host=localhost user=x password=y dbname=z")
  </code></pre>
  
  <p>however it fails when I try to pass it into sequel</p>
  
  <pre><code>&gt; Sequel.postgres(constr)
  Sequel::DatabaseConnectionError: PG::ConnectionBad: could not connect to server: No such file or directory
  </code></pre>
  
  <p>How can I make sequel connect to my database?</p>