-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | Utilities for streaming PostgreSQL LargeObjects -- -- Functions for streaming large objects to and from PostgreSQL @package postgresql-lo-stream @version 0.1.0.0 module Database.PostgreSQL.LargeObjects.Stream -- | Given a strict ByteString, create a postgres large object and fill it -- with those contents. newLargeObjectBS :: Connection -> ByteString -> IO Oid -- | Given a lazy ByteString, create a postgres large object and fill it -- with those contents. Also returns the total length of the data -- written. newLargeObjectLBS :: Connection -> ByteString -> IO (Oid, Int) -- | Create a new large object from an input stream, returning its object -- id and overall size. newLargeObjectStream :: Connection -> InputStream ByteString -> IO (Oid, Int) -- | Act on a large object given by id, opening and closing the file -- descriptor appropriately. withLargeObject :: Connection -> Oid -> IOMode -> (LoFd -> IO a) -> IO a -- | Stream the contents of a database large object to the given output -- stream. Useful with Snap's addToOutput. streamLargeObject :: Connection -> Oid -> OutputStream Builder -> IO () -- | Stream the contents of a database large object to the given output -- stream. Useful with Snap's addToOutput. streamLargeObjectRange :: Connection -> Oid -> Int -> Int -> OutputStream Builder -> IO () -- | Act on the contents of a LargeObject as a Lazy ByteString withLargeObjectLBS :: Connection -> Oid -> (ByteString -> IO ()) -> IO ()