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

Erik de Castro Lopo mle+hs at mega-nerd.com
Fri Nov 23 23:15:11 CET 2012

Erik de Castro Lopo wrote:

> There are still some problems typing all these and they all still return
> a list instead of a value whereas the SQL statement returns a single value.

I stand corrected! This:

    queryTableNameCount :: SqlPersist IO [Value Int64]
    queryTableNameCount =
        select . from $ \(_ :: SqlExpr (Entity TableName)) -> return countRows

returns a singleton list with the correct value and no type checker warnings.

Erik de Castro Lopo

More information about the web-devel mailing list