hasql-interpolate-0.1.0.1: QuasiQuoter that supports expression interpolation for hasql
Safe HaskellNone
LanguageHaskell2010

Hasql.Interpolate.Internal.TH

Synopsis

Documentation

sql :: QuasiQuoter Source #

QuasiQuoter that supports interpolation and splices. Produces a Sql.

#{..} interpolates a haskell expression into a sql query.

example1 :: EncodeValue a => a -> Sql
example1 x = [sql| select #{x} |]

^{..} introduces a splice, which allows us to inject a sql snippet along with the associated parameters into another sql snippet.

example2 :: Sql
example2 = [sql| ^{example1 True} where true |]

data SqlExpr Source #

Instances

Instances details
Eq SqlExpr Source # 
Instance details

Defined in Hasql.Interpolate.Internal.TH

Methods

(==) :: SqlExpr -> SqlExpr -> Bool #

(/=) :: SqlExpr -> SqlExpr -> Bool #

Show SqlExpr Source # 
Instance details

Defined in Hasql.Interpolate.Internal.TH

data ParamEncoder Source #

Constructors

Pe'Exp Exp 
Pe'Var Int 

Instances

Instances details
Eq ParamEncoder Source # 
Instance details

Defined in Hasql.Interpolate.Internal.TH

Show ParamEncoder Source # 
Instance details

Defined in Hasql.Interpolate.Internal.TH

data SpliceBind Source #

Constructors

SpliceBind 

Instances

Instances details
Eq SpliceBind Source # 
Instance details

Defined in Hasql.Interpolate.Internal.TH

Show SpliceBind Source # 
Instance details

Defined in Hasql.Interpolate.Internal.TH