title: HTSQL - Get Count/number of records to be returned by a query
body: <p>I am trying to achieve server side pagination with <a href="http://htsql.org/" rel="nofollow">HTSQL</a> and <a href="https://datatables.net/" rel="nofollow">jQuery Datatables</a> with server side being Django. The datatable initially requires total number of records so that it could manage the pagination. So if I have a simple HTSQL query like:</p>
  
  <pre><code>/program
  </code></pre>
  
  <p>(click the link below for preview)</p>
  
  <p><a href="http://demo.htsql.org/program" rel="nofollow">/program</a></p>
  
  <p>I would simply do:</p>
  
  <pre><code>/count(program)
  </code></pre>
  
  <p><a href="http://demo.htsql.org/count%28program%29" rel="nofollow">/count(program)</a></p>
  
  <p>and I would get the total number of records which my simple query is going to return. But for instance, if I have a HTSQL query like:</p>
  
  <pre><code>/program.filter(school_code=$code){school_code, code, title}:where($code:='eng')
  </code></pre>
  
  <p><a href="http://demo.htsql.org/program.filter%28school_code=%24code%29%7Bschool_code,%20code,%20title%7D%3awhere%28%24code%3a=%27eng%27%29" rel="nofollow">/program.filter(school_code=$code){school_code, code, title}:where($code:='eng')</a></p>
  
  <p>(my Queries are much more complex than that but this would do for an example. Like I have distinct '^' as well as nested queries)</p>
  
  <p>and now I want to get a count of number of records I would get if I run this query so that I could further use it to initialize any table for server side pagination. I tried:</p>
  
  <pre><code>/count(program.filter(school_code=$code){school_code, code, title}:where($code:='eng'))
  </code></pre>
  
  <p><a href="http://demo.htsql.org/count%28program.filter%28school_code=%24code%29%7Bschool_code,%20code,%20title%7D%3awhere%28%24code%3a=%27eng%27%29%29" rel="nofollow">/count(program.filter(school_code=$code){school_code, code, title}:where($code:='eng'))</a></p>
  
  <p>but got error "Function 'count' expects 1 argument; got 3".</p>
  
  <p>Any clue how could I get the count/number of records which my query is going to return?</p>