postgresql-typed-0.6.2.5: PostgreSQL interface with compile-time SQL type checking, optional HDBC backend
Copyright2015 Dylan Simon
Safe HaskellNone
LanguageHaskell2010

Database.PostgreSQL.Typed.Dynamic

Description

Automatic (dynamic) marshalling of PostgreSQL values based on Haskell types (not SQL statements). This is intended for direct construction of queries and query data, bypassing the normal SQL type inference.

Synopsis

Documentation

class (PGParameter (PGRepType a) a, PGColumn (PGRepType a) a) => PGRep a Source #

Represents canonical/default PostgreSQL representation for various Haskell types, allowing convenient type-driven marshalling.

Associated Types

type PGRepType a :: Symbol Source #

The PostgreSOL type that this type should be converted to.

Instances

Instances details
PGRep Value Source # 
Instance details

Defined in Database.PostgreSQL.Typed.Dynamic

Associated Types

type PGRepType Value 
Instance details

Defined in Database.PostgreSQL.Typed.Dynamic

type PGRepType Value = "jsonb"
PGRep ByteString Source # 
Instance details

Defined in Database.PostgreSQL.Typed.Dynamic

Associated Types

type PGRepType ByteString 
Instance details

Defined in Database.PostgreSQL.Typed.Dynamic

type PGRepType ByteString = "text"
PGRep Int16 Source # 
Instance details

Defined in Database.PostgreSQL.Typed.Dynamic

Associated Types

type PGRepType Int16 
Instance details

Defined in Database.PostgreSQL.Typed.Dynamic

type PGRepType Int16 = "smallint"
PGRep Int32 Source # 
Instance details

Defined in Database.PostgreSQL.Typed.Dynamic

Associated Types

type PGRepType Int32 
Instance details

Defined in Database.PostgreSQL.Typed.Dynamic

type PGRepType Int32 = "integer"
PGRep Int64 Source # 
Instance details

Defined in Database.PostgreSQL.Typed.Dynamic

Associated Types

type PGRepType Int64 
Instance details

Defined in Database.PostgreSQL.Typed.Dynamic

type PGRepType Int64 = "bigint"
PGRep Rational Source # 
Instance details

Defined in Database.PostgreSQL.Typed.Dynamic

Associated Types

type PGRepType Rational 
Instance details

Defined in Database.PostgreSQL.Typed.Dynamic

type PGRepType Rational = "numeric"
PGRep OID Source # 
Instance details

Defined in Database.PostgreSQL.Typed.Dynamic

Associated Types

type PGRepType OID 
Instance details

Defined in Database.PostgreSQL.Typed.Dynamic

type PGRepType OID = "oid"
PGRep PGName Source # 
Instance details

Defined in Database.PostgreSQL.Typed.Dynamic

Associated Types

type PGRepType PGName 
Instance details

Defined in Database.PostgreSQL.Typed.Dynamic

type PGRepType PGName = "text"
PGRep Scientific Source # 
Instance details

Defined in Database.PostgreSQL.Typed.Dynamic

Associated Types

type PGRepType Scientific 
Instance details

Defined in Database.PostgreSQL.Typed.Dynamic

type PGRepType Scientific = "numeric"
PGRep Text Source # 
Instance details

Defined in Database.PostgreSQL.Typed.Dynamic

Associated Types

type PGRepType Text 
Instance details

Defined in Database.PostgreSQL.Typed.Dynamic

type PGRepType Text = "text"
PGRep Day Source # 
Instance details

Defined in Database.PostgreSQL.Typed.Dynamic

Associated Types

type PGRepType Day 
Instance details

Defined in Database.PostgreSQL.Typed.Dynamic

type PGRepType Day = "date"
PGRep DiffTime Source # 
Instance details

Defined in Database.PostgreSQL.Typed.Dynamic

Associated Types

type PGRepType DiffTime 
Instance details

Defined in Database.PostgreSQL.Typed.Dynamic

type PGRepType DiffTime = "interval"
PGRep UTCTime Source # 
Instance details

Defined in Database.PostgreSQL.Typed.Dynamic

Associated Types

type PGRepType UTCTime 
Instance details

Defined in Database.PostgreSQL.Typed.Dynamic

type PGRepType UTCTime = "timestamp with time zone"
PGRep LocalTime Source # 
Instance details

Defined in Database.PostgreSQL.Typed.Dynamic

Associated Types

type PGRepType LocalTime 
Instance details

Defined in Database.PostgreSQL.Typed.Dynamic

type PGRepType LocalTime = "timestamp without time zone"
PGRep TimeOfDay Source # 
Instance details

Defined in Database.PostgreSQL.Typed.Dynamic

Associated Types

type PGRepType TimeOfDay 
Instance details

Defined in Database.PostgreSQL.Typed.Dynamic

type PGRepType TimeOfDay = "time without time zone"
PGRep UUID Source # 
Instance details

Defined in Database.PostgreSQL.Typed.Dynamic

Associated Types

type PGRepType UUID 
Instance details

Defined in Database.PostgreSQL.Typed.Dynamic

type PGRepType UUID = "uuid"
PGRep String Source # 
Instance details

Defined in Database.PostgreSQL.Typed.Dynamic

Associated Types

type PGRepType String 
Instance details

Defined in Database.PostgreSQL.Typed.Dynamic

type PGRepType String = "text"
PGRep () Source # 
Instance details

Defined in Database.PostgreSQL.Typed.Dynamic

Associated Types

type PGRepType () 
Instance details

Defined in Database.PostgreSQL.Typed.Dynamic

type PGRepType () = "void"
PGRep Bool Source # 
Instance details

Defined in Database.PostgreSQL.Typed.Dynamic

Associated Types

type PGRepType Bool 
Instance details

Defined in Database.PostgreSQL.Typed.Dynamic

type PGRepType Bool = "boolean"
PGRep Char Source # 
Instance details

Defined in Database.PostgreSQL.Typed.Dynamic

Associated Types

type PGRepType Char 
Instance details

Defined in Database.PostgreSQL.Typed.Dynamic

type PGRepType Char = "\"char\""
PGRep Double Source # 
Instance details

Defined in Database.PostgreSQL.Typed.Dynamic

Associated Types

type PGRepType Double 
Instance details

Defined in Database.PostgreSQL.Typed.Dynamic

type PGRepType Double = "double precision"
PGRep Float Source # 
Instance details

Defined in Database.PostgreSQL.Typed.Dynamic

Associated Types

type PGRepType Float 
Instance details

Defined in Database.PostgreSQL.Typed.Dynamic

type PGRepType Float = "real"
PGRep a => PGRep (Maybe a) Source # 
Instance details

Defined in Database.PostgreSQL.Typed.Dynamic

Associated Types

type PGRepType (Maybe a) 
Instance details

Defined in Database.PostgreSQL.Typed.Dynamic

PGRep (TimeOfDay, TimeZone) Source # 
Instance details

Defined in Database.PostgreSQL.Typed.Dynamic

Associated Types

type PGRepType (TimeOfDay, TimeZone) 
Instance details

Defined in Database.PostgreSQL.Typed.Dynamic

type PGRepType (TimeOfDay, TimeZone) = "time with time zone"

pgEncodeRep :: PGRep a => a -> PGValue Source #

Encode a value using pgEncodeValue.

pgDecodeRep :: PGRep a => PGValue -> a Source #

Decode a value using pgDecodeValue.

pgLiteralRep :: PGRep a => a -> ByteString Source #

Produce a literal value for interpolation in a SQL statement using pgLiteral. Using pgSafeLiteral is usually safer as it includes type cast.

pgLiteralString :: PGRep a => a -> String Source #

Produce a raw SQL literal from a value. Using pgSafeLiteral is usually safer when interpolating in a SQL statement.

pgSafeLiteral :: PGRep a => a -> ByteString Source #

Produce a safely type-cast literal value for interpolation in a SQL statement, e.g., "'123'::integer".

pgSafeLiteralString :: PGRep a => a -> String Source #

Identical to unpack . pgSafeLiteral but more efficient.

pgSubstituteLiterals :: String -> ExpQ Source #

Create an expression that literally substitutes each instance of ${expr} for the result of pgSafeLiteral expr, producing a lazy ByteString. This lets you do safe, type-driven literal substitution into SQL fragments without needing a full query, bypassing placeholder inference and any prepared queries, for example when using pgSimpleQuery or pgSimpleQueries_. Unlike most other TH functions, this does not require any database connection.