@@ -20,5 +20,14 @@ import Rel8.Table.Opaleye ( valuesspec )
20import Rel8.Schema.Context ( DB )
20import Rel8.Schema.Context ( DB )
23+-- | Construct a query that returns the given input list of rows. This is like
24+-- folding a list of 'return' statements under 'union', but uses the SQL
25+-- @VALUES@ expression for efficiency.
27+-- Typically @values@ will be used with 'lit':
29+-- >>> mapM_ Data.Text.IO.putStrLn =<< select c (values [ lit "Hello", lit "World!" ])
23values :: (Table DB a, Foldable f) => f a -> Query a
32values :: (Table DB a, Foldable f) => f a -> Query a
24values = fromOpaleye . Opaleye.valuesExplicit valuesspec . toList
33values = fromOpaleye . Opaleye.valuesExplicit valuesspec . toList