postgresql-simple-0.2.4.1: Mid-Level PostgreSQL client library

Maintainer | leon@melding-monads.com
Safe Haskell | None

Database.PostgreSQL.Simple.LargeObjects

Description

Support for PostgreSQL's Large Objects; see http://www.postgresql.org/docs/9.1/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`, `loImport`, `loExport`, and `loUnlink`, you will need to run the entire sequence of functions in a 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
  - = AbsoluteSeek
  - | RelativeSeek
  - | SeekFromEnd

# Documentation

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

Constructors

Oid CUInt |

Instances

Eq Oid |
Ord Oid |
Read Oid |
Show Oid |
Storable Oid |
ToField Oid |
FromField Oid |

data LoFd

LoFd is a Large Object (pseudo) File Descriptor. It is understood by libpq but not by operating system calls.

Instances

Eq LoFd |
Ord LoFd |
Show LoFd |

data IOMode

See `openFile`

Constructors

ReadMode |
WriteMode |
AppendMode |
ReadWriteMode |

Instances

Enum IOMode |
Eq IOMode |
Ord IOMode |
Read IOMode |
Show IOMode |
Ix IOMode |

data SeekMode

A mode that determines the effect of `hSeek` `hdl mode i`.

Constructors

AbsoluteSeek | the position of `hdl` is set to `i`.
RelativeSeek | the position of `hdl` is set to offset `i` from the current position.
SeekFromEnd | the position of `hdl` is set to offset `i` from the end of the file.

Instances

Enum SeekMode |
Eq SeekMode |
Ord SeekMode |
Read SeekMode |
Show SeekMode |
Ix SeekMode |