Safe Haskell | None |
---|---|
Language | Haskell2010 |
Preql.Wire.FromSql
Description
Decoding values from Postgres wire format to Haskell.
Synopsis
- data FieldDecoder a = FieldDecoder Oid (BinaryParser a)
- throwLocated :: UnlocatedFieldError -> InternalDecoder a
- decodeVector :: RowDecoder a -> Result -> IO (Either QueryError (Vector a))
- notNull :: FieldDecoder a -> RowDecoder a
- nullable :: FieldDecoder a -> RowDecoder (Maybe a)
- class FromSqlField a where
- fromSqlField :: FieldDecoder a
- class FromSql a where
- fromSql :: RowDecoder a
- fromSqlJsonField :: FromJSON a => FieldDecoder a
Documentation
data FieldDecoder a Source #
A FieldDecoder
for a type a
consists of an OID indicating the
Postgres type which can be decoded, and a parser from the binary
representation of that type to the Haskell representation.
Constructors
FieldDecoder Oid (BinaryParser a) |
Instances
Functor FieldDecoder Source # | |
Defined in Preql.Wire.FromSql Methods fmap :: (a -> b) -> FieldDecoder a -> FieldDecoder b # (<$) :: a -> FieldDecoder b -> FieldDecoder a # |
decodeVector :: RowDecoder a -> Result -> IO (Either QueryError (Vector a)) Source #
notNull :: FieldDecoder a -> RowDecoder a Source #
nullable :: FieldDecoder a -> RowDecoder (Maybe a) Source #
class FromSqlField a where Source #
Methods
fromSqlField :: FieldDecoder a Source #
Instances
class FromSql a where Source #
Methods
fromSql :: RowDecoder a Source #
Instances
FromSql Bool Source # | |
Defined in Preql.Wire.FromSql Methods fromSql :: RowDecoder Bool Source # | |
FromSql Double Source # | |
Defined in Preql.Wire.FromSql Methods | |
FromSql Float Source # | |
Defined in Preql.Wire.FromSql Methods | |
FromSql Int16 Source # | |
Defined in Preql.Wire.FromSql Methods | |
FromSql Int32 Source # | |
Defined in Preql.Wire.FromSql Methods | |
FromSql Int64 Source # | |
Defined in Preql.Wire.FromSql Methods | |
FromSql ByteString Source # | |
Defined in Preql.Wire.FromSql Methods | |
FromSql ByteString Source # | |
Defined in Preql.Wire.FromSql Methods | |
FromSql Text Source # | |
Defined in Preql.Wire.FromSql Methods fromSql :: RowDecoder Text Source # | |
FromSql UTCTime Source # | |
Defined in Preql.Wire.FromSql Methods | |
FromSql Value Source # | |
Defined in Preql.Wire.FromSql Methods | |
FromSql Text Source # | |
Defined in Preql.Wire.FromSql Methods fromSql :: RowDecoder Text Source # | |
FromSql String Source # | |
Defined in Preql.Wire.FromSql Methods | |
FromSql UUID Source # | |
Defined in Preql.Wire.FromSql Methods fromSql :: RowDecoder UUID Source # | |
FromSql Day Source # | |
Defined in Preql.Wire.FromSql Methods fromSql :: RowDecoder Day Source # | |
FromSql TimeOfDay Source # | |
Defined in Preql.Wire.FromSql Methods | |
FromSql TimeTZ Source # | |
Defined in Preql.Wire.FromSql Methods | |
FromSqlField a => FromSql (Maybe a) Source # | |
Defined in Preql.Wire.FromSql Methods fromSql :: RowDecoder (Maybe a) Source # | |
(FromSql a, FromSql b) => FromSql (a, b) Source # | |
Defined in Preql.Wire.FromSql Methods fromSql :: RowDecoder (a, b) Source # | |
(FromSql a, FromSql b, FromSql c) => FromSql (a, b, c) Source # | |
Defined in Preql.Wire.FromSql Methods fromSql :: RowDecoder (a, b, c) Source # | |
(FromSql a, FromSql b, FromSql c, FromSql d) => FromSql (a, b, c, d) Source # | |
Defined in Preql.Wire.FromSql Methods fromSql :: RowDecoder (a, b, c, d) Source # | |
(FromSql a, FromSql b, FromSql c, FromSql d, FromSql e) => FromSql (a, b, c, d, e) Source # | |
Defined in Preql.Wire.FromSql Methods fromSql :: RowDecoder (a, b, c, d, e) Source # | |
(FromSql a, FromSql b, FromSql c, FromSql d, FromSql e, FromSql f) => FromSql (a, b, c, d, e, f) Source # | |
Defined in Preql.Wire.FromSql Methods fromSql :: RowDecoder (a, b, c, d, e, f) Source # | |
(FromSql a, FromSql b, FromSql c, FromSql d, FromSql e, FromSql f, FromSql g) => FromSql (a, b, c, d, e, f, g) Source # | |
Defined in Preql.Wire.FromSql Methods fromSql :: RowDecoder (a, b, c, d, e, f, g) Source # | |
(FromSql a, FromSql b, FromSql c, FromSql d, FromSql e, FromSql f, FromSql g, FromSql h) => FromSql (a, b, c, d, e, f, g, h) Source # | |
Defined in Preql.Wire.FromSql Methods fromSql :: RowDecoder (a, b, c, d, e, f, g, h) Source # | |
(FromSql a, FromSql b, FromSql c, FromSql d, FromSql e, FromSql f, FromSql g, FromSql h, FromSql i) => FromSql (a, b, c, d, e, f, g, h, i) Source # | |
Defined in Preql.Wire.FromSql Methods fromSql :: RowDecoder (a, b, c, d, e, f, g, h, i) Source # | |
(FromSql a, FromSql b, FromSql c, FromSql d, FromSql e, FromSql f, FromSql g, FromSql h, FromSql i, FromSql j) => FromSql (a, b, c, d, e, f, g, h, i, j) Source # | |
Defined in Preql.Wire.FromSql Methods fromSql :: RowDecoder (a, b, c, d, e, f, g, h, i, j) Source # | |
(FromSql a, FromSql b, FromSql c, FromSql d, FromSql e, FromSql f, FromSql g, FromSql h, FromSql i, FromSql j, FromSql k) => FromSql (a, b, c, d, e, f, g, h, i, j, k) Source # | |
Defined in Preql.Wire.FromSql Methods fromSql :: RowDecoder (a, b, c, d, e, f, g, h, i, j, k) Source # | |
(FromSql a, FromSql b, FromSql c, FromSql d, FromSql e, FromSql f, FromSql g, FromSql h, FromSql i, FromSql j, FromSql k, FromSql l) => FromSql (a, b, c, d, e, f, g, h, i, j, k, l) Source # | |
Defined in Preql.Wire.FromSql Methods fromSql :: RowDecoder (a, b, c, d, e, f, g, h, i, j, k, l) Source # | |
(FromSql a, FromSql b, FromSql c, FromSql d, FromSql e, FromSql f, FromSql g, FromSql h, FromSql i, FromSql j, FromSql k, FromSql l, FromSql m) => FromSql (a, b, c, d, e, f, g, h, i, j, k, l, m) Source # | |
Defined in Preql.Wire.FromSql Methods fromSql :: RowDecoder (a, b, c, d, e, f, g, h, i, j, k, l, m) Source # | |
(FromSql a, FromSql b, FromSql c, FromSql d, FromSql e, FromSql f, FromSql g, FromSql h, FromSql i, FromSql j, FromSql k, FromSql l, FromSql m, FromSql n) => FromSql (a, b, c, d, e, f, g, h, i, j, k, l, m, n) Source # | |
Defined in Preql.Wire.FromSql Methods fromSql :: RowDecoder (a, b, c, d, e, f, g, h, i, j, k, l, m, n) Source # | |
(FromSql a, FromSql b, FromSql c, FromSql d, FromSql e, FromSql f, FromSql g, FromSql h, FromSql i, FromSql j, FromSql k, FromSql l, FromSql m, FromSql n, FromSql o) => FromSql (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o) Source # | |
Defined in Preql.Wire.FromSql Methods fromSql :: RowDecoder (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o) Source # | |
(FromSql a, FromSql b, FromSql c, FromSql d, FromSql e, FromSql f, FromSql g, FromSql h, FromSql i, FromSql j, FromSql k, FromSql l, FromSql m, FromSql n, FromSql o, FromSql p) => FromSql (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p) Source # | |
Defined in Preql.Wire.FromSql Methods fromSql :: RowDecoder (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p) Source # | |
(FromSql a, FromSql b, FromSql c, FromSql d, FromSql e, FromSql f, FromSql g, FromSql h, FromSql i, FromSql j, FromSql k, FromSql l, FromSql m, FromSql n, FromSql o, FromSql p, FromSql q) => FromSql (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q) Source # | |
Defined in Preql.Wire.FromSql Methods fromSql :: RowDecoder (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q) Source # | |
(FromSql a, FromSql b, FromSql c, FromSql d, FromSql e, FromSql f, FromSql g, FromSql h, FromSql i, FromSql j, FromSql k, FromSql l, FromSql m, FromSql n, FromSql o, FromSql p, FromSql q, FromSql r) => FromSql (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r) Source # | |
Defined in Preql.Wire.FromSql Methods fromSql :: RowDecoder (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r) Source # | |
(FromSql a, FromSql b, FromSql c, FromSql d, FromSql e, FromSql f, FromSql g, FromSql h, FromSql i, FromSql j, FromSql k, FromSql l, FromSql m, FromSql n, FromSql o, FromSql p, FromSql q, FromSql r, FromSql s) => FromSql (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s) Source # | |
Defined in Preql.Wire.FromSql Methods fromSql :: RowDecoder (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s) Source # | |
(FromSql a, FromSql b, FromSql c, FromSql d, FromSql e, FromSql f, FromSql g, FromSql h, FromSql i, FromSql j, FromSql k, FromSql l, FromSql m, FromSql n, FromSql o, FromSql p, FromSql q, FromSql r, FromSql s, FromSql t) => FromSql (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t) Source # | |
Defined in Preql.Wire.FromSql Methods fromSql :: RowDecoder (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t) Source # | |
(FromSql a, FromSql b, FromSql c, FromSql d, FromSql e, FromSql f, FromSql g, FromSql h, FromSql i, FromSql j, FromSql k, FromSql l, FromSql m, FromSql n, FromSql o, FromSql p, FromSql q, FromSql r, FromSql s, FromSql t, FromSql u) => FromSql (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u) Source # | |
Defined in Preql.Wire.FromSql Methods fromSql :: RowDecoder (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u) Source # | |
(FromSql a, FromSql b, FromSql c, FromSql d, FromSql e, FromSql f, FromSql g, FromSql h, FromSql i, FromSql j, FromSql k, FromSql l, FromSql m, FromSql n, FromSql o, FromSql p, FromSql q, FromSql r, FromSql s, FromSql t, FromSql u, FromSql v) => FromSql (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v) Source # | |
Defined in Preql.Wire.FromSql Methods fromSql :: RowDecoder (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v) Source # | |
(FromSql a, FromSql b, FromSql c, FromSql d, FromSql e, FromSql f, FromSql g, FromSql h, FromSql i, FromSql j, FromSql k, FromSql l, FromSql m, FromSql n, FromSql o, FromSql p, FromSql q, FromSql r, FromSql s, FromSql t, FromSql u, FromSql v, FromSql w) => FromSql (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w) Source # | |
Defined in Preql.Wire.FromSql Methods fromSql :: RowDecoder (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w) Source # | |
(FromSql a, FromSql b, FromSql c, FromSql d, FromSql e, FromSql f, FromSql g, FromSql h, FromSql i, FromSql j, FromSql k, FromSql l, FromSql m, FromSql n, FromSql o, FromSql p, FromSql q, FromSql r, FromSql s, FromSql t, FromSql u, FromSql v, FromSql w, FromSql x) => FromSql (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x) Source # | |
Defined in Preql.Wire.FromSql Methods fromSql :: RowDecoder (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x) Source # | |
(FromSql a, FromSql b, FromSql c, FromSql d, FromSql e, FromSql f, FromSql g, FromSql h, FromSql i, FromSql j, FromSql k, FromSql l, FromSql m, FromSql n, FromSql o, FromSql p, FromSql q, FromSql r, FromSql s, FromSql t, FromSql u, FromSql v, FromSql w, FromSql x, FromSql y) => FromSql (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y) Source # | |
Defined in Preql.Wire.FromSql Methods fromSql :: RowDecoder (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y) Source # |
fromSqlJsonField :: FromJSON a => FieldDecoder a Source #