Hoogle Search
Within LTS Haskell 24.46 (ghc-9.10.3)
Note that Stackage only displays results for the latest LTS and Nightly snapshot. Learn more.
executeMany :: ToRow q => Connection -> Query -> [q] -> IO Int64postgresql-simple Database.PostgreSQL.Simple Execute a multi-row INSERT, UPDATE, or other SQL query that is not expected to return results. Returns the number of rows affected. If the list of parameters is empty, this function will simply return 0 without issuing the query to the backend. If this is not desired, consider using the Values constructor instead. Throws FormatError if the query could not be formatted correctly, or a SqlError exception if the backend returns an error. For example, here's a command that inserts two rows into a table with two columns:
executeMany c [sql| INSERT INTO sometable VALUES (?,?) |] [(1, "hello"),(2, "world")]
Here's an canonical example of a multi-row update command:executeMany c [sql| UPDATE sometable SET y = upd.y FROM (VALUES (?,?)) as upd(x,y) WHERE sometable.x = upd.x |] [(1, "hello"),(2, "world")]
formatMany :: ToRow q => Connection -> Query -> [q] -> IO ByteStringpostgresql-simple Database.PostgreSQL.Simple Format a query string with a variable number of rows. This function is exposed to help with debugging and logging. Do not use it to prepare queries for execution. The query string must contain exactly one substitution group, identified by the SQL keyword "VALUES" (case insensitive) followed by an "(" character, a series of one or more "?" characters separated by commas, and a ")" character. White space in a substitution group is permitted. Throws FormatError if the query string could not be formatted correctly.
-
postgresql-simple Database.PostgreSQL.Simple.Ok a way to reify a list of exceptions into a single exception
ManyErrors :: [SomeException] -> ManyErrorspostgresql-simple Database.PostgreSQL.Simple.Ok No documentation available.
-
postgresql-simple Database.PostgreSQL.Simple.ToField Concatenate a series of rendering actions.
-
explicit-exception Control.Monad.Exception.Asynchronous.Lazy We advise to use the Endo Monoid when you want to read a series of characters into a list. This means you use the difference lists technique in order to build the list, which is efficient.
import Data.Monoid (Endo, appEndo, ) import Control.Exception (try, ) import qualified Control.Monad.Exception.Synchronous as Sync
fmap (flip appEndo []) $ manyMonoidT (fromSynchronousMonoidT $ fmap (Endo . (:)) $ Sync.fromEitherT $ try getChar)
If you want Lazy IO you must additionally convert getChar to LazyIO monad. -
explicit-exception Control.Monad.Exception.Asynchronous.Lazy Deprecated: use manyMonoidT with appropriate Monad like LazyIO and result Monoid like Endo instead
-
explicit-exception Control.Monad.Exception.Asynchronous.Strict We advise to use the Endo Monoid when you want to read a series of characters into a list. This means you use the difference lists technique in order to build the list, which is efficient.
import Data.Monoid (Endo, appEndo, ) import Control.Exception (try, ) import qualified Control.Monad.Exception.Synchronous as Sync
fmap (flip appEndo []) $ manyMonoidT (fromSynchronousMonoidT $ fmap (Endo . (:)) $ Sync.fromEitherT $ try getChar)
If you want Lazy IO you must additionally convert getChar to LazyIO monad. -
explicit-exception Control.Monad.Exception.Asynchronous.Strict Deprecated: use manyMonoidT with appropriate Monad like LazyIO and result Monoid like Endo instead
-
explicit-exception Control.Monad.Exception.Synchronous No documentation available.