on master help sign in
Document each
commit134ddcfb2f2d46b4154580e59e06f1fcad875209 authorOllie Charles <ollie@ocharles.org.uk> dateTue 23 Mar 2021, 16:19 (6 years ago) parent8a441e6
1 file changed+7
src/Rel8/Query/Each.hs+7
src/Rel8/Query/Each.hs+7
@@ -20,6 +20,13 @@ import Rel8.Table.Opaleye ( table, unpackspec )
2020import Rel8.Table.Recontextualize ( Selects )
2121
2222
23+-- | Select each row from a table definition. This is equivalent to @FROM
24+-- table@.
25+--
26+-- >>> mapM_ print =<< select c (each projectSchema)
27+-- Project {projectAuthorId = 1, projectName = "rel8"}
28+-- Project {projectAuthorId = 2, projectName = "aeson"}
29+-- Project {projectAuthorId = 2, projectName = "text"}
2330each :: Selects names exprs => TableSchema names -> Query exprs
2431each =
2532 fmap fromColumns .