beam-postgres-0.5.2.1: Connection layer between beam and postgres
Safe Haskell None
Language Haskell2010

Database.Beam.Postgres.Conduit

Description

More efficient query execution functions for beam-postgres . These functions use the conduit package, to execute beam-postgres statements in an arbitrary MonadIO . These functions may be more efficient for streaming operations than MonadBeam .

Synopsis

Documentation

runInsert :: MonadIO m => Connection -> SqlInsert Postgres tbl -> m Int64 Source #

Run a PostgreSQL INSERT statement in any MonadIO . Returns the number of rows affected.

streamingRunInsertReturning :: ( MonadResource m, MonadFail m, FromBackendRow Postgres a) => Connection -> PgInsertReturning a -> ConduitT () a m () Source #

Run a PostgreSQL INSERT ... RETURNING ... statement in any MonadResource and get a Source of the newly inserted rows.

runUpdate :: MonadIO m => Connection -> SqlUpdate Postgres tbl -> m Int64 Source #

Run a PostgreSQL UPDATE statement in any MonadIO . Returns the number of rows affected.

streamingRunUpdateReturning :: ( MonadResource m, MonadFail m, FromBackendRow Postgres a) => Connection -> PgUpdateReturning a -> ConduitT () a m () Source #

Run a PostgreSQL UPDATE ... RETURNING ... statement in any MonadResource and get a Source of the newly updated rows.

runDelete :: MonadIO m => Connection -> SqlDelete Postgres tbl -> m Int64 Source #

Run a PostgreSQL DELETE statement in any MonadIO . Returns the number of rows affected.

streamingRunDeleteReturning :: ( MonadResource m, MonadFail m, FromBackendRow Postgres a) => Connection -> PgDeleteReturning a -> ConduitT () a m () Source #

Run a PostgreSQl DELETE ... RETURNING ... statement in any MonadResource and get a Source of the deleted rows.

executeStatement :: MonadIO m => Connection -> PgSyntax -> m Int64 Source #

Run any DML statement. Return the number of rows affected

Deprecated streaming variants

runSelect :: ( MonadIO m, MonadFail m, MonadBaseControl IO m, FromBackendRow Postgres a) => Connection -> SqlSelect Postgres a -> ( ConduitT () a m () -> m b) -> m b Source #

Deprecated: Use streamingRunSelect

Run a PostgreSQL SELECT statement in any MonadIO .

runInsertReturning :: ( MonadIO m, MonadFail m, MonadBaseControl IO m, FromBackendRow Postgres a) => Connection -> PgInsertReturning a -> ( ConduitT () a m () -> m b) -> m b Source #

Deprecated: Use streamingRunInsertReturning

Run a PostgreSQL INSERT ... RETURNING ... statement in any MonadIO and get a Source of the newly inserted rows.

runUpdateReturning :: ( MonadIO m, MonadFail m, MonadBaseControl IO m, FromBackendRow Postgres a) => Connection -> PgUpdateReturning a -> ( ConduitT () a m () -> m b) -> m b Source #

Deprecated: Use streamingRunUpdateReturning

Run a PostgreSQL UPDATE ... RETURNING ... statement in any MonadIO and get a Source of the newly updated rows.

runDeleteReturning :: ( MonadIO m, MonadFail m, MonadBaseControl IO m, FromBackendRow Postgres a) => Connection -> PgDeleteReturning a -> ( ConduitT () a m () -> m b) -> m b Source #

Deprecated: Use streamingRunDeleteReturning

Run a PostgreSQl DELETE ... RETURNING ... statement in any MonadIO and get a Source of the deleted rows.

runQueryReturning :: ( MonadIO m, MonadFail m, MonadBaseControl IO m, Functor m, FromBackendRow Postgres r) => Connection -> PgSyntax -> ( ConduitT () r m () -> m b) -> m b Source #

Deprecated: Use streamingRunQueryReturning

Runs any query that returns a set of values