title: Using StaticQuery for a dynamiclly built query string
body: <pre><code>StaticQuery.queryNA[(String, String)](query)
  </code></pre>
  
  <p>where <code>query</code> String gets constructed dynamically (programmatically)  so number of columns returned from the query isn't known ahead of time. </p>
  
  <p>sample query </p>
  
  <pre><code>select 
    (select field-&gt;&gt;'value' from json_array_elements(vcolor.field_ids_json-&gt;'fields') as field where (field-&gt;&gt;'ddid')::int = 113)
    as mycolor
  , 
  
    (select field-&gt;&gt;'value' from json_array_elements(ins.field_ids_json-&gt;'fields') as field where (field-&gt;&gt;'ddud')::int = 131)
    as insp
  </code></pre>
  
  <p>above query is built programmatically and may have 10 or 20 such sub-queries each returning one value.</p>
  
  <p>What's the best way to write such a dynamic function queries like this? </p>