preql-0.5: safe PostgreSQL queries using Quasiquoters
Safe HaskellNone
LanguageHaskell2010

Preql.Wire.ToSql

Synopsis

Documentation

data FieldEncoder a Source #

A FieldEncoder for a type a consists of a function from a to it's binary representation, and an Postgres OID which tells Postgres it's type & how to decode it.

Constructors

FieldEncoder Oid (a -> Builder) 

Instances

Instances details
Contravariant FieldEncoder Source # 
Instance details

Defined in Preql.Wire.ToSql

Methods

contramap :: (a -> b) -> FieldEncoder b -> FieldEncoder a #

(>$) :: b -> FieldEncoder b -> FieldEncoder a #

type RowEncoder a = a -> [(Oid, ByteString)] Source #

class ToSqlField a where Source #

Types which can be encoded to a single Postgres field.

Instances

Instances details
ToSqlField Bool Source # 
Instance details

Defined in Preql.Wire.ToSql

ToSqlField Char Source # 
Instance details

Defined in Preql.Wire.ToSql

ToSqlField Double Source # 
Instance details

Defined in Preql.Wire.ToSql

ToSqlField Float Source # 
Instance details

Defined in Preql.Wire.ToSql

ToSqlField Int16 Source # 
Instance details

Defined in Preql.Wire.ToSql

ToSqlField Int32 Source # 
Instance details

Defined in Preql.Wire.ToSql

ToSqlField Int64 Source # 
Instance details

Defined in Preql.Wire.ToSql

ToSqlField ByteString Source #

If you want to encode some more specific Haskell type via JSON, it is more efficient to use encode and jsonb_bytes directly, rather than this instance.

Instance details

Defined in Preql.Wire.ToSql

ToSqlField ByteString Source # 
Instance details

Defined in Preql.Wire.ToSql

ToSqlField String Source # 
Instance details

Defined in Preql.Wire.ToSql

ToSqlField Text Source # 
Instance details

Defined in Preql.Wire.ToSql

ToSqlField UTCTime Source # 
Instance details

Defined in Preql.Wire.ToSql

ToSqlField Value Source #

If you want to encode some more specific Haskell type via JSON, it is more efficient to use toSqlJsonField rather than this instance.

Instance details

Defined in Preql.Wire.ToSql

ToSqlField Text Source # 
Instance details

Defined in Preql.Wire.ToSql

ToSqlField UUID Source # 
Instance details

Defined in Preql.Wire.ToSql

ToSqlField Day Source # 
Instance details

Defined in Preql.Wire.ToSql

ToSqlField TimeOfDay Source # 
Instance details

Defined in Preql.Wire.ToSql

ToSqlField TimeTZ Source # 
Instance details

Defined in Preql.Wire.ToSql

class ToSql a where Source #

ToSql a is sufficient to pass a as parameters to a paramaterized query.

Methods

toSql :: RowEncoder a Source #

Instances

Instances details
ToSql Bool Source # 
Instance details

Defined in Preql.Wire.ToSql

ToSql Char Source # 
Instance details

Defined in Preql.Wire.ToSql

ToSql Double Source # 
Instance details

Defined in Preql.Wire.ToSql

ToSql Float Source # 
Instance details

Defined in Preql.Wire.ToSql

ToSql Int16 Source # 
Instance details

Defined in Preql.Wire.ToSql

ToSql Int32 Source # 
Instance details

Defined in Preql.Wire.ToSql

ToSql Int64 Source # 
Instance details

Defined in Preql.Wire.ToSql

ToSql () Source # 
Instance details

Defined in Preql.Wire.ToSql

Methods

toSql :: RowEncoder () Source #

ToSql ByteString Source # 
Instance details

Defined in Preql.Wire.ToSql

ToSql ByteString Source # 
Instance details

Defined in Preql.Wire.ToSql

ToSql String Source # 
Instance details

Defined in Preql.Wire.ToSql

ToSql Text Source # 
Instance details

Defined in Preql.Wire.ToSql

ToSql UTCTime Source # 
Instance details

Defined in Preql.Wire.ToSql

ToSql Value Source # 
Instance details

Defined in Preql.Wire.ToSql

ToSql Text Source # 
Instance details

Defined in Preql.Wire.ToSql

ToSql UUID Source # 
Instance details

Defined in Preql.Wire.ToSql

ToSql Day Source # 
Instance details

Defined in Preql.Wire.ToSql

ToSql TimeOfDay Source # 
Instance details

Defined in Preql.Wire.ToSql

ToSql TimeTZ Source # 
Instance details

Defined in Preql.Wire.ToSql

(ToSqlField a, ToSqlField b) => ToSql (a, b) Source # 
Instance details

Defined in Preql.Wire.ToSql

Methods

toSql :: RowEncoder (a, b) Source #

(ToSqlField a, ToSqlField b, ToSqlField c) => ToSql (a, b, c) Source # 
Instance details

Defined in Preql.Wire.ToSql

Methods

toSql :: RowEncoder (a, b, c) Source #

(ToSqlField a, ToSqlField b, ToSqlField c, ToSqlField d) => ToSql (a, b, c, d) Source # 
Instance details

Defined in Preql.Wire.ToSql

Methods

toSql :: RowEncoder (a, b, c, d) Source #

(ToSqlField a, ToSqlField b, ToSqlField c, ToSqlField d, ToSqlField e) => ToSql (a, b, c, d, e) Source # 
Instance details

Defined in Preql.Wire.ToSql

Methods

toSql :: RowEncoder (a, b, c, d, e) Source #

(ToSqlField a, ToSqlField b, ToSqlField c, ToSqlField d, ToSqlField e, ToSqlField f) => ToSql (a, b, c, d, e, f) Source # 
Instance details

Defined in Preql.Wire.ToSql

Methods

toSql :: RowEncoder (a, b, c, d, e, f) Source #

(ToSqlField a, ToSqlField b, ToSqlField c, ToSqlField d, ToSqlField e, ToSqlField f, ToSqlField g) => ToSql (a, b, c, d, e, f, g) Source # 
Instance details

Defined in Preql.Wire.ToSql

Methods

toSql :: RowEncoder (a, b, c, d, e, f, g) Source #

(ToSqlField a, ToSqlField b, ToSqlField c, ToSqlField d, ToSqlField e, ToSqlField f, ToSqlField g, ToSqlField h) => ToSql (a, b, c, d, e, f, g, h) Source # 
Instance details

Defined in Preql.Wire.ToSql

Methods

toSql :: RowEncoder (a, b, c, d, e, f, g, h) Source #

(ToSqlField a, ToSqlField b, ToSqlField c, ToSqlField d, ToSqlField e, ToSqlField f, ToSqlField g, ToSqlField h, ToSqlField i) => ToSql (a, b, c, d, e, f, g, h, i) Source # 
Instance details

Defined in Preql.Wire.ToSql

Methods

toSql :: RowEncoder (a, b, c, d, e, f, g, h, i) Source #

(ToSqlField a, ToSqlField b, ToSqlField c, ToSqlField d, ToSqlField e, ToSqlField f, ToSqlField g, ToSqlField h, ToSqlField i, ToSqlField j) => ToSql (a, b, c, d, e, f, g, h, i, j) Source # 
Instance details

Defined in Preql.Wire.ToSql

Methods

toSql :: RowEncoder (a, b, c, d, e, f, g, h, i, j) Source #

(ToSqlField a, ToSqlField b, ToSqlField c, ToSqlField d, ToSqlField e, ToSqlField f, ToSqlField g, ToSqlField h, ToSqlField i, ToSqlField j, ToSqlField k) => ToSql (a, b, c, d, e, f, g, h, i, j, k) Source # 
Instance details

Defined in Preql.Wire.ToSql

Methods

toSql :: RowEncoder (a, b, c, d, e, f, g, h, i, j, k) Source #

(ToSqlField a, ToSqlField b, ToSqlField c, ToSqlField d, ToSqlField e, ToSqlField f, ToSqlField g, ToSqlField h, ToSqlField i, ToSqlField j, ToSqlField k, ToSqlField l) => ToSql (a, b, c, d, e, f, g, h, i, j, k, l) Source # 
Instance details

Defined in Preql.Wire.ToSql

Methods

toSql :: RowEncoder (a, b, c, d, e, f, g, h, i, j, k, l) Source #

(ToSqlField a, ToSqlField b, ToSqlField c, ToSqlField d, ToSqlField e, ToSqlField f, ToSqlField g, ToSqlField h, ToSqlField i, ToSqlField j, ToSqlField k, ToSqlField l, ToSqlField m) => ToSql (a, b, c, d, e, f, g, h, i, j, k, l, m) Source # 
Instance details

Defined in Preql.Wire.ToSql

Methods

toSql :: RowEncoder (a, b, c, d, e, f, g, h, i, j, k, l, m) Source #

(ToSqlField a, ToSqlField b, ToSqlField c, ToSqlField d, ToSqlField e, ToSqlField f, ToSqlField g, ToSqlField h, ToSqlField i, ToSqlField j, ToSqlField k, ToSqlField l, ToSqlField m, ToSqlField n) => ToSql (a, b, c, d, e, f, g, h, i, j, k, l, m, n) Source # 
Instance details

Defined in Preql.Wire.ToSql

Methods

toSql :: RowEncoder (a, b, c, d, e, f, g, h, i, j, k, l, m, n) Source #

(ToSqlField a, ToSqlField b, ToSqlField c, ToSqlField d, ToSqlField e, ToSqlField f, ToSqlField g, ToSqlField h, ToSqlField i, ToSqlField j, ToSqlField k, ToSqlField l, ToSqlField m, ToSqlField n, ToSqlField o) => ToSql (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o) Source # 
Instance details

Defined in Preql.Wire.ToSql

Methods

toSql :: RowEncoder (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o) Source #

(ToSqlField a, ToSqlField b, ToSqlField c, ToSqlField d, ToSqlField e, ToSqlField f, ToSqlField g, ToSqlField h, ToSqlField i, ToSqlField j, ToSqlField k, ToSqlField l, ToSqlField m, ToSqlField n, ToSqlField o, ToSqlField p) => ToSql (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p) Source # 
Instance details

Defined in Preql.Wire.ToSql

Methods

toSql :: RowEncoder (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p) Source #

(ToSqlField a, ToSqlField b, ToSqlField c, ToSqlField d, ToSqlField e, ToSqlField f, ToSqlField g, ToSqlField h, ToSqlField i, ToSqlField j, ToSqlField k, ToSqlField l, ToSqlField m, ToSqlField n, ToSqlField o, ToSqlField p, ToSqlField q) => ToSql (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q) Source # 
Instance details

Defined in Preql.Wire.ToSql

Methods

toSql :: RowEncoder (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q) Source #

(ToSqlField a, ToSqlField b, ToSqlField c, ToSqlField d, ToSqlField e, ToSqlField f, ToSqlField g, ToSqlField h, ToSqlField i, ToSqlField j, ToSqlField k, ToSqlField l, ToSqlField m, ToSqlField n, ToSqlField o, ToSqlField p, ToSqlField q, ToSqlField r) => ToSql (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r) Source # 
Instance details

Defined in Preql.Wire.ToSql

Methods

toSql :: RowEncoder (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r) Source #

(ToSqlField a, ToSqlField b, ToSqlField c, ToSqlField d, ToSqlField e, ToSqlField f, ToSqlField g, ToSqlField h, ToSqlField i, ToSqlField j, ToSqlField k, ToSqlField l, ToSqlField m, ToSqlField n, ToSqlField o, ToSqlField p, ToSqlField q, ToSqlField r, ToSqlField s) => ToSql (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s) Source # 
Instance details

Defined in Preql.Wire.ToSql

Methods

toSql :: RowEncoder (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s) Source #

(ToSqlField a, ToSqlField b, ToSqlField c, ToSqlField d, ToSqlField e, ToSqlField f, ToSqlField g, ToSqlField h, ToSqlField i, ToSqlField j, ToSqlField k, ToSqlField l, ToSqlField m, ToSqlField n, ToSqlField o, ToSqlField p, ToSqlField q, ToSqlField r, ToSqlField s, ToSqlField t) => ToSql (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t) Source # 
Instance details

Defined in Preql.Wire.ToSql

Methods

toSql :: RowEncoder (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t) Source #

(ToSqlField a, ToSqlField b, ToSqlField c, ToSqlField d, ToSqlField e, ToSqlField f, ToSqlField g, ToSqlField h, ToSqlField i, ToSqlField j, ToSqlField k, ToSqlField l, ToSqlField m, ToSqlField n, ToSqlField o, ToSqlField p, ToSqlField q, ToSqlField r, ToSqlField s, ToSqlField t, ToSqlField u) => ToSql (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u) Source # 
Instance details

Defined in Preql.Wire.ToSql

Methods

toSql :: RowEncoder (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u) Source #

(ToSqlField a, ToSqlField b, ToSqlField c, ToSqlField d, ToSqlField e, ToSqlField f, ToSqlField g, ToSqlField h, ToSqlField i, ToSqlField j, ToSqlField k, ToSqlField l, ToSqlField m, ToSqlField n, ToSqlField o, ToSqlField p, ToSqlField q, ToSqlField r, ToSqlField s, ToSqlField t, ToSqlField u, ToSqlField v) => ToSql (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v) Source # 
Instance details

Defined in Preql.Wire.ToSql

Methods

toSql :: RowEncoder (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v) Source #

(ToSqlField a, ToSqlField b, ToSqlField c, ToSqlField d, ToSqlField e, ToSqlField f, ToSqlField g, ToSqlField h, ToSqlField i, ToSqlField j, ToSqlField k, ToSqlField l, ToSqlField m, ToSqlField n, ToSqlField o, ToSqlField p, ToSqlField q, ToSqlField r, ToSqlField s, ToSqlField t, ToSqlField u, ToSqlField v, ToSqlField w) => ToSql (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w) Source # 
Instance details

Defined in Preql.Wire.ToSql

Methods

toSql :: RowEncoder (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w) Source #

(ToSqlField a, ToSqlField b, ToSqlField c, ToSqlField d, ToSqlField e, ToSqlField f, ToSqlField g, ToSqlField h, ToSqlField i, ToSqlField j, ToSqlField k, ToSqlField l, ToSqlField m, ToSqlField n, ToSqlField o, ToSqlField p, ToSqlField q, ToSqlField r, ToSqlField s, ToSqlField t, ToSqlField u, ToSqlField v, ToSqlField w, ToSqlField x) => ToSql (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 # 
Instance details

Defined in Preql.Wire.ToSql

Methods

toSql :: RowEncoder (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 #

(ToSqlField a, ToSqlField b, ToSqlField c, ToSqlField d, ToSqlField e, ToSqlField f, ToSqlField g, ToSqlField h, ToSqlField i, ToSqlField j, ToSqlField k, ToSqlField l, ToSqlField m, ToSqlField n, ToSqlField o, ToSqlField p, ToSqlField q, ToSqlField r, ToSqlField s, ToSqlField t, ToSqlField u, ToSqlField v, ToSqlField w, ToSqlField x, ToSqlField y) => ToSql (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 # 
Instance details

Defined in Preql.Wire.ToSql

Methods

toSql :: RowEncoder (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 #