Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- newLargeObjectBS :: Connection -> ByteString -> IO Oid
- newLargeObjectLBS :: Connection -> ByteString -> IO (Oid, Int)
- newLargeObjectStream :: Connection -> InputStream ByteString -> IO (Oid, Int)
- withLargeObject :: Connection -> Oid -> IOMode -> (LoFd -> IO a) -> IO a
- streamLargeObject :: Connection -> Oid -> OutputStream Builder -> IO ()
- streamLargeObjectRange :: Connection -> Oid -> Int -> Int -> OutputStream Builder -> IO ()
- withLargeObjectLBS :: Connection -> Oid -> (ByteString -> IO ()) -> IO ()
Documentation
newLargeObjectBS :: Connection -> ByteString -> IO Oid Source #
Given a strict ByteString, create a postgres large object and fill it with those contents.
newLargeObjectLBS :: Connection -> ByteString -> IO (Oid, Int) Source #
Given a lazy ByteString, create a postgres large object and fill it with those contents. Also returns the total length of the data written.
newLargeObjectStream :: Connection -> InputStream ByteString -> IO (Oid, Int) Source #
Create a new large object from an input stream, returning its object id and overall size.
withLargeObject :: Connection -> Oid -> IOMode -> (LoFd -> IO a) -> IO a Source #
Act on a large object given by id, opening and closing the file descriptor appropriately.
streamLargeObject :: Connection -> Oid -> OutputStream Builder -> IO () Source #
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 () Source #
Stream the contents of a database large object to the given output stream. Useful with Snap's addToOutput
.
withLargeObjectLBS :: Connection -> Oid -> (ByteString -> IO ()) -> IO () Source #
Act on the contents of a LargeObject as a Lazy ByteString