on master help sign in
Document each
134ddcfOllie Charles
src/Rel8/Query/Each.hs+7
@@ -20,6 +20,13 @@ import Rel8.Table.Opaleye ( table, unpackspec )
20import Rel8.Table.Recontextualize ( Selects )
20import Rel8.Table.Recontextualize ( Selects )
21
21
22
22
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"}
23each :: Selects names exprs => TableSchema names -> Query exprs
30each :: Selects names exprs => TableSchema names -> Query exprs
24each =
31each =
25 fmap fromColumns .
32 fmap fromColumns .