Safe Haskell | None |
---|---|
Language | Haskell2010 |
Exports of this module are concerned with columns in a Postgres query result. This includes validation of type and format. Parsing of the actual cell values in a column is delegated to PostgreSQL.Result.Cell.
Synopsis
- newtype Column a = Column {
- parseColumn :: Oid -> Format -> Either ParserErrors (Cell a)
- ignored :: Column ()
- raw :: Column ByteString
- text :: Column Text
- readable :: Read a => Column a
- unchecked :: Cell a -> Column a
- validate :: Column a -> (a -> Either Text b) -> Column b
- onlyTextual :: Column a -> Column a
- onlyBinary :: Column a -> Column a
- class AutoColumn a where
- autoColumn :: Column a
- newtype Readable a = Readable a
- data RawValue = RawValue {}
Column
Result column parser
Since: 0.0.0
Column | |
|
Basics
raw :: Column ByteString Source #
Raw value. Rejects NULL
.
Since: 0.0.0
Helpful combinators
unchecked :: Cell a -> Column a Source #
Lift a cell parser. This does perform any validation on column type or format.
Since: 0.0.0
validate :: Column a -> (a -> Either Text b) -> Column b Source #
Validate the result of a cell parser.
Since: 0.0.0
onlyTextual :: Column a -> Column a Source #
Only allow textual format.
Since: 0.0.0
onlyBinary :: Column a -> Column a Source #
Only allow binary format.
Since: 0.0.0
Class
class AutoColumn a where Source #
Default column parser for a type
Since: 0.0.0
autoColumn :: Column a Source #
Default column parser for a
Since: 0.0.0
Instances
Helpers
Provides a AutoColumn
instance using the Read
for a
Since: 0.0.0
Readable a |
Instances
Read a => AutoColumn (Readable a) Source # | Since: 0.0.0 |
Defined in PostgreSQL.Result.Column autoColumn :: Column (Readable a) Source # |