git.iko.soy/typeable/postgresql-simple
on master help sign in
Add a comment about the `returning` operator
34030afLeon P Smith
src/Database/PostgreSQL/Simple.hs+4
@@ -350,6 +350,10 @@ executeMany conn q qs = do
350
350
351-- | Execute @INSERT ... RETURNING@, @UPDATE ... RETURNING@, or other SQL
351-- | Execute @INSERT ... RETURNING@, @UPDATE ... RETURNING@, or other SQL
352-- query that accepts multi-row input and is expected to return results.
352-- 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'.
353--
357--
354-- Throws 'FormatError' if the query could not be formatted correctly.
358-- Throws 'FormatError' if the query could not be formatted correctly.
355returning :: (ToRow q, FromRow r) => Connection -> Query -> [q] -> IO [r]
359returning :: (ToRow q, FromRow r) => Connection -> Query -> [q] -> IO [r]