Yesod. Persistent. The little problem

Hi All, i have the difficulty to build query kind of *select * from Table T where T.f1 = v1 and (T.f2 = v2 or T.f3 = v2) * how to make this one with Yesod Persistent. Are there any ideas ? Thanks. -- Best regards, Cheshkov Anton Phone: +7 909 005 18 82 Skype: cheshkov_anton

liftM2 (nub . (++)) (selectList [TableF1Eq v1, TableF2Eq v2] [] 0 0) (selectList [TableF1Eq v1, TableF3Eq v2] [] 0 0) its not very efficient, and mike will yell at me for using nub, but its good enough for 230 am. goodnight, max On May 13, 2011, at 2:15 AM, Anton Cheshkov wrote:
Hi All,
i have the difficulty to build query kind of
select * from Table T where T.f1 = v1 and (T.f2 = v2 or T.f3 = v2)
how to make this one with Yesod Persistent. Are there any ideas ?
Thanks.
-- Best regards, Cheshkov Anton Phone: +7 909 005 18 82 Skype: cheshkov_anton _______________________________________________ web-devel mailing list web-devel@haskell.org http://www.haskell.org/mailman/listinfo/web-devel

This is a good candidate for raw where clauses in the spirit of RoR's active
record. (How we make those type-safe, I don't know.. I'll give it some
thought)
On Thu, May 12, 2011 at 2:24 PM, Max Cantor
liftM2 (nub . (++)) (selectList [TableF1Eq v1, TableF2Eq v2] [] 0 0) (selectList [TableF1Eq v1, TableF3Eq v2] [] 0 0)
its not very efficient, and mike will yell at me for using nub, but its good enough for 230 am.
goodnight, max
On May 13, 2011, at 2:15 AM, Anton Cheshkov wrote:
Hi All,
i have the difficulty to build query kind of
select * from Table T where T.f1 = v1 and (T.f2 = v2 or T.f3 = v2)
how to make this one with Yesod Persistent. Are there any ideas ?
Thanks.
-- Best regards, Cheshkov Anton Phone: +7 909 005 18 82 Skype: cheshkov_anton _______________________________________________ web-devel mailing list web-devel@haskell.org http://www.haskell.org/mailman/listinfo/web-devel
_______________________________________________ web-devel mailing list web-devel@haskell.org http://www.haskell.org/mailman/listinfo/web-devel

Isn't this sort of functionality covered by the "In" proposal?
On Fri, May 13, 2011 at 5:25 AM, Rick Richardson
This is a good candidate for raw where clauses in the spirit of RoR's active record. (How we make those type-safe, I don't know.. I'll give it some thought)
On Thu, May 12, 2011 at 2:24 PM, Max Cantor
wrote: liftM2 (nub . (++)) (selectList [TableF1Eq v1, TableF2Eq v2] [] 0 0) (selectList [TableF1Eq v1, TableF3Eq v2] [] 0 0)
its not very efficient, and mike will yell at me for using nub, but its good enough for 230 am.
goodnight, max
On May 13, 2011, at 2:15 AM, Anton Cheshkov wrote:
Hi All,
i have the difficulty to build query kind of
select * from Table T where T.f1 = v1 and (T.f2 = v2 or T.f3 = v2)
how to make this one with Yesod Persistent. Are there any ideas ?
Thanks.
-- Best regards, Cheshkov Anton Phone: +7 909 005 18 82 Skype: cheshkov_anton _______________________________________________ web-devel mailing list web-devel@haskell.org http://www.haskell.org/mailman/listinfo/web-devel
_______________________________________________ web-devel mailing list web-devel@haskell.org http://www.haskell.org/mailman/listinfo/web-devel
_______________________________________________ web-devel mailing list web-devel@haskell.org http://www.haskell.org/mailman/listinfo/web-devel
-- -barkmadley sent from an internet enabled device
participants (4)
-
Anton Cheshkov
-
Mark Bradley
-
Max Cantor
-
Rick Richardson