Modulepostgresql-binary-0.13.1.3Haskell2010
PostgreSQL.Binary.Decoding
- 3 types
- 39 values
- Packagepostgresql-binary-0.13.1.3
- Exports42
- LanguageHaskell2010
- LicenceMIT
- SourceDecoding.hs
Primitive
6 declarationsBYTEA or any other type in its undecoded form.
BYTEA or any other type in its undecoded form.
Textual
3 declarationsAny of the variable-length character types: BPCHAR, VARCHAR, NAME and TEXT.
Any of the variable-length character types: BPCHAR, VARCHAR, NAME and TEXT.
A UTF-8-decoded char.
Misc
8 declarationsLifts a custom decoder implementation.
Given a function, which parses a plain UTF-8 JSON string encoded as a byte-array, produces a decoder.
Given a function, which parses a plain UTF-8 JSON string encoded as a byte-array, produces a decoder.
For those wondering, yes, JSONB is encoded as plain JSON string in the binary format of Postgres. Sad, but true.
Time
11 declarationsDATE values decoding.
TIME values decoding for servers, which have integer_datetimes enabled.
TIME values decoding for servers, which don't have integer_datetimes enabled.
TIMETZ values decoding for servers, which have integer_datetimes enabled.
TIMETZ values decoding for servers, which don't have integer_datetimes enabled.
TIMESTAMP values decoding for servers, which have integer_datetimes enabled.
TIMESTAMP values decoding for servers, which don't have integer_datetimes enabled.
TIMESTAMP values decoding for servers, which have integer_datetimes enabled.
TIMESTAMP values decoding for servers, which don't have integer_datetimes enabled.
INTERVAL values decoding for servers, which don't have integer_datetimes enabled.
INTERVAL values decoding for servers, which have integer_datetimes enabled.
Exotic
0 declarationsArray
An efficient generic array decoder, which constructs the result value in place while parsing.
Here's how you can use it to produce a specific array value decoder:
x :: Value [ [ Text ] ]
x =
array (dimensionArray replicateM (fmap catMaybes (dimensionArray replicateM (nullableValueArray text))))
A function for parsing a dimension of an array. Provides support for multi-dimensional arrays.
Accepts:
An implementation of the
replicateMfunction (Control.Monad.replicateM,Data.Vector.replicateM), which determines the output value.A decoder of its components, which can be either another dimensionArray or nullableValueArray.
Composite
Instances4Monad, Functor, MonadFail, Applicative
Monad CompositeDefined in postgresql-binary-0.13.1.3 · PostgreSQL.Binary.DecodingFunctor CompositeDefined in postgresql-binary-0.13.1.3 · PostgreSQL.Binary.DecodingMonadFail CompositeDefined in postgresql-binary-0.13.1.3 · PostgreSQL.Binary.DecodingApplicative CompositeDefined in postgresql-binary-0.13.1.3 · PostgreSQL.Binary.Decoding
HStore
A function for generic in place parsing of an HStore value.
Accepts:
An implementation of the
replicateMfunction (Control.Monad.replicateM,Data.Vector.replicateM), which determines how to produce the final datastructure from the rows.A decoder for keys.
A decoder for values.
Here's how you can use it to produce a parser to list:
hstoreAsList :: Value [ ( Text , Maybe Text ) ]
hstoreAsList =
hstore replicateM text text
Given a partial mapping from text to value, produces a decoder of that value.
Given additional constraints when using an existing value decoder, produces a decoder of that value.