git.iko.soy/typeable/postgresql-simple
on master help sign in
Add a comment about the `returning` operator
commit34030afa0ef66ea3f94166b5601c51a834fde638 authorLeon P Smith <leon@melding-monads.com> dateThu 9 Aug 2012, 11:38 (14 years ago) parentb3b0ef2
1 file changed+4
src/Database/PostgreSQL/Simple.hs+4
src/Database/PostgreSQL/Simple.hs+4
@@ -350,6 +350,10 @@ executeMany conn q qs = do
350350
351351-- | Execute @INSERT ... RETURNING@, @UPDATE ... RETURNING@, or other SQL
352352-- query that accepts multi-row input and is expected to return results.
353+-- Note that it is possible to write
354+-- @'query' conn "INSERT ... RETURNING ..." ...@
355+-- in cases where you are only inserting a single row, and do not need
356+-- functionality analogous to 'executeMany'.
353357--
354358-- Throws 'FormatError' if the query could not be formatted correctly.
355359returning :: (ToRow q, FromRow r) => Connection -> Query -> [q] -> IO [r]