[web-devel] yesod database select all rows?

Max Cantor mxcantor at gmail.com
Tue Jun 28 03:06:17 CEST 2011


We have this command in our testing code. I'm out of town now but will send when I get back tonight. 

On Jun 27, 2011, at 6:55, Greg Weber <greg at gregweber.info> wrote:

> On Sun, Jun 26, 2011 at 4:20 PM, Eric Schug <schugschug at gmail.com> wrote:
> Hello,
> It does not seem obvious to me how to perform the equivalent of
> 
> SELECT * FROM table_name
> SELECT field1,field2 FROM table_name
> 
> examples show something of the form
> rows <- runDB $ selectList [ Field1Eq value1, Field2Gt value2] [ ] 0 0
> But I don't see how the name of the table is determined nor how to select additional fields to extract.
> 
> What would this do?
> rows <- runDB $ selectList [ ] [ ] 0 0
> 
> There is only one way to find out :)
> 
> Speaking of which, we should create a `yesod console` command so that it is easy to play around with the database. Basically it connects to the database and gets you ready to run Persistent queries.
> 
> 
> 
> 
> _______________________________________________
> web-devel mailing list
> web-devel at haskell.org
> http://www.haskell.org/mailman/listinfo/web-devel
> 
> _______________________________________________
> web-devel mailing list
> web-devel at haskell.org
> http://www.haskell.org/mailman/listinfo/web-devel
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/web-devel/attachments/20110628/42fc7278/attachment.htm>


More information about the web-devel mailing list