Update example.

This commit is contained in:
Kei Hibino 2013-05-18 12:00:53 +09:00
parent 53e20120b2
commit ff1ce8f787

View File

@ -15,16 +15,16 @@ import Database.HDBC.Session (withConnectionIO)
um :: Relation (User, Maybe Membership) um :: Relation (User, Maybe Membership)
um = relation $ um = relation $
[ u >*< m [ u >*< m
| u <- inner user | u <- query user
, m <- outer membership , m <- queryMaybe membership
, () <- on $ just (u ! User.id') .=. m !? userId' , () <- on $ just (u ! User.id') .=. m !? userId'
] ]
r0 :: Relation (Maybe User, Maybe Group) r0 :: Relation (Maybe User, Maybe Group)
r0 = relation $ r0 = relation $
[ (um' !? fst') >*< g [ (um' !? fst') >*< g
| um' <- outer um | um' <- queryMaybe um
, g <- outer group , g <- queryMaybe group
, () <- on $ flatten (um' !? snd') !? groupId' .=. g !? Group.id' , () <- on $ flatten (um' !? snd') !? groupId' .=. g !? Group.id'
] ]