postgresql-binary-0.5.1: Encoders and decoders for the PostgreSQL's binary format

Safe HaskellNone
LanguageHaskell2010

PostgreSQLBinary.Decoder

Contents

Synopsis

Documentation

type D a = ByteString -> Either Text a Source

A function for decoding a byte string into a value.

Numbers

int :: (Integral a, Bits a) => D a Source

Any of PostgreSQL integer types.

Text

char :: D Char Source

A UTF-8-encoded char.

text :: D Text Source

Any of the variable-length character types: BPCHAR, VARCHAR, NAME and TEXT.

Date and Time

time :: Bool -> D TimeOfDay Source

The decoding strategy depends on whether the server supports integer_datetimes.

timetz :: Bool -> D (TimeOfDay, TimeZone) Source

The decoding strategy depends on whether the server supports integer_datetimes.

timestamp :: Bool -> D LocalTime Source

The decoding strategy depends on whether the server supports integer_datetimes.

timestamptz :: Bool -> D UTCTime Source

The decoding strategy depends on whether the server supports integer_datetimes.

interval :: Bool -> D DiffTime Source

The decoding strategy depends on whether the server supports integer_datetimes.

Misc

array :: D Data Source

Arbitrary array.

Returns an intermediate representation, which can then be used to decode into a specific data type.