-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | Convert various postgresql-simple calls to work with pipes -- -- This library provides a few Producers and Consumers that allow -- postgresql-simple calls to be made within the pipes -- framework. Currently, there is support for: -- -- @package pipes-postgresql-simple @version 0.1.3.0 module Pipes.PostgreSQL.Simple.SafeT -- | The PostgreSQL file format, used by the COPY command data Format Text :: Format Binary :: Format CSV :: Format toTable :: (MonadIO m, MonadSafe m, Base m ~ IO) => Connection -> Format -> String -> Consumer ByteString m a instance GHC.Show.Show Pipes.PostgreSQL.Simple.SafeT.Format -- | Pipes utilities built on top of postgresql-simple module Pipes.PostgreSQL.Simple -- | Convert a query to a Producer of rows. -- -- For example, -- --
--   pg <- connectToPostgresql
--   query pg "SELECT * FROM widgets WHERE ID = ?" (Only widgetId) >-> print
--   
-- -- Will select all widgets for a given widgetId, and then print -- each row to standard output. query :: (MonadIO m, FromRow r, ToRow params) => Connection -> Query -> params -> Producer r m () -- | Like query, but it doesn't perform any query parameter -- substitution. query_ :: (MonadIO m, FromRow r) => Connection -> Query -> Producer r m () -- | The PostgreSQL file format, used by the COPY command data Format Text :: Format Binary :: Format CSV :: Format -- | Convert a table to a byte stream. This is equivilent to a PostgreSQL -- COPY ... TO statement. -- -- Returns the number of rows processed. fromTable :: MonadIO m => Connection -> Format -> String -> Producer ByteString m Int64 -- | Convert a byte stream to a table. This is equivilent to a PostgreSQL -- COPY ... FROM statement. -- -- Returns the number of rows processed toTable :: (MonadCatch m, MonadIO m) => Connection -> Format -> String -> Producer ByteString m () -> m Int64