[web-devel] Esqueleto : SELECT COUNT(*) FROM table_name ;

Gaël Deest gael.deest at gmail.com
Fri Nov 23 12:16:39 CET 2012


Le 23/11/12 12:04, Erik de Castro Lopo a écrit :
> Francesco Mazzoli wrote:
>
>> Have you looked at
>> <http://hackage.haskell.org/packages/archive/esqueleto/0.2.8/doc/html/Database-Esqueleto.html#v:countRows>?
>> I didn’t try, but it looks promising.
> The examples in that section still suggest that the SELECT statement
> that is run against the database returns an element for each row
> whereas the what I'm hoping for is a single element returned, the
> row count.
>
> Erik
Never played with Esqueleto, but it looks to me like the following would 
work:

count <- select $ from \foo -> do
   return countRows




More information about the web-devel mailing list