Safe Haskell | None |
---|---|
Language | Haskell2010 |
- type PGTransaction = PGTransactionT IO
- runPGTransactionT :: MonadBaseControl IO m => PGTransactionT m a -> Connection -> m a
- runPGTransactionT' :: MonadBaseControl IO m => IsolationLevel -> PGTransactionT m a -> Connection -> m a
- runPGTransactionIO :: MonadIO m => PGTransaction a -> Connection -> m a
- query :: (ToRow input, FromRow output, MonadIO m) => input -> Query -> PGTransactionT m [output]
- query_ :: (FromRow output, MonadIO m) => Query -> PGTransactionT m [output]
- execute :: (ToRow input, MonadIO m) => input -> Query -> PGTransactionT m Int64
- executeOne :: (ToRow input, MonadIO m) => input -> Query -> PGTransactionT m Bool
- executeMany :: (ToRow input, MonadIO m) => [input] -> Query -> PGTransactionT m Int64
- returning :: (ToRow input, FromRow output, MonadIO m) => [input] -> Query -> PGTransactionT m [output]
- queryHead :: (ToRow input, FromRow output, MonadIO m) => input -> Query -> PGTransactionT m (Maybe output)
- queryOnly :: (ToRow input, FromField f, MonadIO m) => input -> Query -> PGTransactionT m (Maybe f)
- formatQuery :: (ToRow input, MonadIO m) => input -> Query -> PGTransactionT m Query
Documentation
type PGTransaction = PGTransactionT IO Source
runPGTransactionT :: MonadBaseControl IO m => PGTransactionT m a -> Connection -> m a Source
runPGTransactionT' :: MonadBaseControl IO m => IsolationLevel -> PGTransactionT m a -> Connection -> m a Source
runPGTransactionIO :: MonadIO m => PGTransaction a -> Connection -> m a Source
Convenience function when there are no embedded monadic effects, only IO.
query :: (ToRow input, FromRow output, MonadIO m) => input -> Query -> PGTransactionT m [output] Source
Issue an SQL query, taking a ToRow
input and yielding FromRow
outputs.
Please note that the parameter order is different from that in the parent
postgresql-simple library; this is an intentional choice to improve the aesthetics
when using the SQL quasiquoter (making the query parameters come first means that
there is more room for the query string).
query_ :: (FromRow output, MonadIO m) => Query -> PGTransactionT m [output] Source
As query
, but for queries that take no arguments.
execute :: (ToRow input, MonadIO m) => input -> Query -> PGTransactionT m Int64 Source
Run a single SQL action and return success.
executeOne :: (ToRow input, MonadIO m) => input -> Query -> PGTransactionT m Bool Source
Run a statement and return True
if only a single record was modified.
returning :: (ToRow input, FromRow output, MonadIO m) => [input] -> Query -> PGTransactionT m [output] Source
queryHead :: (ToRow input, FromRow output, MonadIO m) => input -> Query -> PGTransactionT m (Maybe output) Source