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

Preql.Wire.Internal

Description

The types in this module have invariants which cannot be checked if their constructors are in scope. Preql.Wire exports the type names only.

Synopsis

Documentation

newtype Query Source #

The IsString instance does no validation; the limited instances discourage directly manipulating strings, with the high risk of SQL injection.

Constructors

Query ByteString 

Instances

Instances details
Show Query Source # 
Instance details

Defined in Preql.Wire.Internal

Methods

showsPrec :: Int -> Query -> ShowS #

show :: Query -> String #

showList :: [Query] -> ShowS #

IsString Query Source # 
Instance details

Defined in Preql.Wire.Internal

Methods

fromString :: String -> Query #

data RowDecoder a Source #

RowDecoder is Applicative but not Monad so that we can assemble all of the OIDs before we read any of the field data sent by Postgres.

Constructors

RowDecoder [PgType] (InternalDecoder a) 

Instances

Instances details
Functor RowDecoder Source # 
Instance details

Defined in Preql.Wire.Internal

Methods

fmap :: (a -> b) -> RowDecoder a -> RowDecoder b #

(<$) :: a -> RowDecoder b -> RowDecoder a #

Applicative RowDecoder Source # 
Instance details

Defined in Preql.Wire.Internal

Methods

pure :: a -> RowDecoder a #

(<*>) :: RowDecoder (a -> b) -> RowDecoder a -> RowDecoder b #

liftA2 :: (a -> b -> c) -> RowDecoder a -> RowDecoder b -> RowDecoder c #

(*>) :: RowDecoder a -> RowDecoder b -> RowDecoder b #

(<*) :: RowDecoder a -> RowDecoder b -> RowDecoder a #

type InternalDecoder = StateT DecoderState (ExceptT FieldError IO) Source #

Internal because we need IO for the libpq FFI, but we promise not to do any IO besides decoding. We don't even make network calls to Postgres in InternalDecoder

data DecoderState Source #

Constructors

DecoderState 

Fields

Instances

Instances details
Eq DecoderState Source # 
Instance details

Defined in Preql.Wire.Internal

Show DecoderState Source # 
Instance details

Defined in Preql.Wire.Internal