title: How to query postgres on optional params?
body: <p>I am setting up an <code>REST</code> service and I am using <code>postgres</code> as the data store.  I want to know how to set up a <code>postgres</code> query to use optional parameters. ie:</p>
  
  <pre><code>SELECT * from users 
  where hair_color = $1 
  and eye_color = $2
  </code></pre>
  
  <p>Where $1 and $2 come from the request: [req.body.hair_color, req.body.eye_color]</p>
  
  <p>What if the user didn't pass in <code>eye_color</code> and in that case I wanted all eye colors.  I assume that I don't have to make a bunch of <code>if/else</code> statements here.  What is the concise way of creating this query?</p>