postgresql-simple-sop 0.1.0.3 → 0.1.0.4
raw patch · 2 files changed
+11/−1 lines, 2 files
Files
postgresql-simple-sop.cabal view
@@ -1,5 +1,5 @@ name: postgresql-simple-sop-version: 0.1.0.3+version: 0.1.0.4 synopsis: Generic functions for postgresql-simple homepage: https://github.com/openbrainsrc/postgresql-simple-sop license: MIT
src/Database/PostgreSQL/Simple/SOP.hs view
@@ -101,3 +101,13 @@ (fromString $ intercalate "," $ map (const "?") fnms) <> ")") val return ()++ginsertManyInto :: forall r. (ToRow r, Generic r, HasFieldNames r) => Connection -> Query -> [r] -> IO ()+ginsertManyInto conn tbl vals = do+ let fnms = fieldNames $ (Proxy :: Proxy r)+ _ <- executeMany conn ("INSERT INTO " <> tbl <> " (" <>+ (fromString $ intercalate "," fnms ) <>+ ") VALUES (" <>+ (fromString $ intercalate "," $ map (const "?") fnms) <> ")")+ vals+ return ()