Copyright | (c) 2011-2012 Leon P Smith |
---|---|
License | BSD3 |
Maintainer | leon@melding-monads.com |
Safe Haskell | None |
Language | Haskell2010 |
Support for PostgreSQL's Large Objects; see https://www.postgresql.org/docs/9.5/static/largeobjects.html for more information.
Note that Large Object File Descriptors are only valid within a single
database transaction, so if you are interested in using anything beyond
loCreat
,
loCreate
, and
loUnlink
, you will need to run the entire
sequence of functions in a transaction. As
loImport
and
loExport
are simply C functions that call
loCreat
,
loOpen
,
loRead
, and
loWrite
, and do not perform any transaction handling themselves,
they also need to be wrapped in an explicit transaction.
Synopsis
- loCreat :: Connection -> IO Oid
- loCreate :: Connection -> Oid -> IO Oid
- loImport :: Connection -> FilePath -> IO Oid
- loImportWithOid :: Connection -> FilePath -> Oid -> IO Oid
- loExport :: Connection -> Oid -> FilePath -> IO ()
- loOpen :: Connection -> Oid -> IOMode -> IO LoFd
- loWrite :: Connection -> LoFd -> ByteString -> IO Int
- loRead :: Connection -> LoFd -> Int -> IO ByteString
- loSeek :: Connection -> LoFd -> SeekMode -> Int -> IO Int
- loTell :: Connection -> LoFd -> IO Int
- loTruncate :: Connection -> LoFd -> Int -> IO ()
- loClose :: Connection -> LoFd -> IO ()
- loUnlink :: Connection -> Oid -> IO ()
- newtype Oid = Oid CUInt
- data LoFd
-
data
IOMode
- = ReadMode
- | WriteMode
- | AppendMode
- | ReadWriteMode
- data SeekMode
Documentation
loImportWithOid :: Connection -> FilePath -> Oid -> IO Oid Source #
loWrite :: Connection -> LoFd -> ByteString -> IO Int Source #
loRead :: Connection -> LoFd -> Int -> IO ByteString Source #
loTruncate :: Connection -> LoFd -> Int -> IO () Source #
Instances
Eq Oid | |
Ord Oid | |
Read Oid | |
Show Oid | |
Storable Oid | |
Defined in Database.PostgreSQL.LibPQ.Oid |
|
ToField Oid Source # | |
FromField Oid Source # |
oid |
Defined in Database.PostgreSQL.Simple.FromField |
LoFd is a Large Object (pseudo) File Descriptor. It is understood by libpq but not by operating system calls.
See
openFile
Instances
Enum IOMode |
Since: base-4.2.0.0 |
Defined in GHC.IO.IOMode succ :: IOMode -> IOMode Source # pred :: IOMode -> IOMode Source # toEnum :: Int -> IOMode Source # fromEnum :: IOMode -> Int Source # enumFrom :: IOMode -> [ IOMode ] Source # enumFromThen :: IOMode -> IOMode -> [ IOMode ] Source # enumFromTo :: IOMode -> IOMode -> [ IOMode ] Source # enumFromThenTo :: IOMode -> IOMode -> IOMode -> [ IOMode ] Source # |
|
Eq IOMode |
Since: base-4.2.0.0 |
Ord IOMode |
Since: base-4.2.0.0 |
Read IOMode |
Since: base-4.2.0.0 |
Show IOMode |
Since: base-4.2.0.0 |
Ix IOMode |
Since: base-4.2.0.0 |
ToCInt IOMode | |
Defined in Database.PostgreSQL.LibPQ.Enums |
A mode that determines the effect of
hSeek
hdl mode i
.
AbsoluteSeek |
the position of
|
RelativeSeek |
the position of
|
SeekFromEnd |
the position of
|
Instances
Enum SeekMode |
Since: base-4.2.0.0 |
Defined in GHC.IO.Device succ :: SeekMode -> SeekMode Source # pred :: SeekMode -> SeekMode Source # toEnum :: Int -> SeekMode Source # fromEnum :: SeekMode -> Int Source # enumFrom :: SeekMode -> [ SeekMode ] Source # enumFromThen :: SeekMode -> SeekMode -> [ SeekMode ] Source # enumFromTo :: SeekMode -> SeekMode -> [ SeekMode ] Source # enumFromThenTo :: SeekMode -> SeekMode -> SeekMode -> [ SeekMode ] Source # |
|
Eq SeekMode |
Since: base-4.2.0.0 |
Ord SeekMode |
Since: base-4.2.0.0 |
Defined in GHC.IO.Device |
|
Read SeekMode |
Since: base-4.2.0.0 |
Show SeekMode |
Since: base-4.2.0.0 |
Ix SeekMode |
Since: base-4.2.0.0 |
Defined in GHC.IO.Device range :: ( SeekMode , SeekMode ) -> [ SeekMode ] Source # index :: ( SeekMode , SeekMode ) -> SeekMode -> Int Source # unsafeIndex :: ( SeekMode , SeekMode ) -> SeekMode -> Int Source # inRange :: ( SeekMode , SeekMode ) -> SeekMode -> Bool Source # |
|
ToCInt SeekMode | |
Defined in Database.PostgreSQL.LibPQ.Enums |