@@ -20,5 +20,14 @@ import Rel8.Table.Opaleye ( valuesspec )
2020import Rel8.Schema.Context ( DB )
2121
2222
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.
26+--
27+-- Typically @values@ will be used with 'lit':
28+--
29+-- >>> mapM_ Data.Text.IO.putStrLn =<< select c (values [ lit "Hello", lit "World!" ])
30+-- Hello
31+-- World!
2332values :: (Table DB a, Foldable f) => f a -> Query a
2433values = fromOpaleye . Opaleye.valuesExplicit valuesspec . toList