-- 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: -- --
-- 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