Safe Haskell | None |
---|---|
Language | Haskell2010 |
Hasql.Postgres
Description
This module contains everything required to use "hasql" with Postgres. For information on how it should be used consult the "hasql" docs.
Please note that there is a few limitations inflicted by Postgres,
encoding which in the type system would seriously burden the API,
so it was decided to make it the user's responsibility
to make sure that certain conditions are satisfied during the runtime.
Particularly this concerns the Mapping
instances of
Maybe
, []
and Vector
.
For details consult the docs on those instances.
Documentation
Settings of a Postgres backend.
Constructors
Postgres | |
Instances
Backend Postgres | |
Mapping Postgres Bool | Maps to |
Mapping Postgres Char | Maps to |
Mapping Postgres Double | Maps to |
Mapping Postgres Float | Maps to |
Mapping Postgres Int | Maps to |
Mapping Postgres Int8 | Maps to |
Mapping Postgres Int16 | Maps to |
Mapping Postgres Int32 | Maps to |
Mapping Postgres Int64 | Maps to |
Mapping Postgres Word | Maps to |
Mapping Postgres Word8 | Maps to |
Mapping Postgres Word16 | Maps to |
Mapping Postgres Word32 | Maps to |
Mapping Postgres Word64 | Maps to |
Mapping Postgres ByteString | Maps to |
Mapping Postgres Text | Maps to |
Mapping Postgres UUID | Maps to |
Mapping Postgres DiffTime | Maps to |
Mapping Postgres Day | Maps to |
Mapping Postgres UTCTime | Maps to |
Mapping Postgres TimeOfDay | Maps to |
Mapping Postgres LocalTime | Maps to NOTICE Postgres does not store the timezone information of This is a notoriously questionable design decision by the Postgres authors.
This is why it is instead recommended to use |
Mapping Postgres Scientific | Maps to |
(Mapping a, ArrayMapping a) => Mapping Postgres [a] | Maps to Postgres arrays. LIMITATION 1 In multidimensional lists all rows of a dimension must have the same length. E.g., the following is a corrupt value: [[1,2], [3]] The following is a valid one: [[1,2], [3,4], [5,6]] LIMITATION 2
E.g., the following is a corrupt type: [Maybe [a]] However, both the first level list and the value are allowed to be wrapped in Maybe [[[Maybe a]]] NOTICE Also, please note that since |
Mapping a => Mapping Postgres (Maybe a) | Maps to the same type as the underlying value,
encoding LIMITATION Multilevel |
(Mapping a, ArrayMapping a) => Mapping Postgres (Vector a) | Maps to Postgres' arrays. Same rules as for the list instance apply. Consult its docs for details. |
Mapping Postgres (TimeOfDay, TimeZone) | Maps to Unlike with |
data Connection Postgres = Connection {
| |
data Result Postgres = Result {} | |
data StatementArgument Postgres = StatementArgument {
|