File tree Expand file tree Collapse file tree 1 file changed +13
-4
lines changed
Expand file tree Collapse file tree 1 file changed +13
-4
lines changed Original file line number Diff line number Diff line change @@ -123,13 +123,21 @@ getOrganizations = select_
123123 (# o ! # id `as` # orgId :* # o ! # name `as` # orgName)
124124 (from (table (# org ! # organizations `as` # o)))
125125
126- getOrganizationsBy :: Query_ Schemas (Only Int32 ) Organization
127- getOrganizationsBy =
126+ getOrganizationsBy ::
127+ Condition
128+ 'Ungrouped
129+ '[]
130+ '[]
131+ Schemas
132+ '[ 'NotNull 'PGint4]
133+ '[" o" ::: [" id" ::: NotNull PGint4 , " name" ::: NotNull PGtext ]] ->
134+ Query_ Schemas (Only Int32 ) Organization
135+ getOrganizationsBy condition =
128136 select_
129137 (# o ! # id `as` # orgId :* # o ! # name `as` # orgName)
130138 (
131139 from (table (# org ! # organizations `as` # o))
132- & where_ ( # o ! # id .== param @ 1 )
140+ & where_ condition
133141 )
134142
135143upsertUser :: Manipulation_ Schemas (Int32 , String , VarArray [Maybe Int16 ]) ()
@@ -192,7 +200,8 @@ session = do
192200 organizationRows <- getRows organizationsResult
193201 liftIO $ print (organizationRows :: [Organization ])
194202
195- organizationsResult2 <- runQueryParams getOrganizationsBy (Only (1 :: Int32 ))
203+ organizationsResult2 <- runQueryParams
204+ (getOrganizationsBy ((# o ! # id ) .== param @ 1 )) (Only (1 :: Int32 ))
196205 organizationRows2 <- getRows organizationsResult2
197206 liftIO $ print (organizationRows2 :: [Organization ])
198207
You can’t perform that action at this time.
0 commit comments