hasql-interpolate-0.2.2.0: 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 |]

addParam :: State Int Builder Source #

parseSqlExpr :: String -> Either (ParseErrorBundle String Void) SqlExpr Source #

data SqlExpr Source #

Instances

Instances details
Show SqlExpr Source # 
Instance details

Defined in Hasql.Interpolate.Internal.TH

Methods

showsPrec :: Int -> SqlExpr -> ShowS

show :: SqlExpr -> String

showList :: [SqlExpr] -> ShowS

Eq SqlExpr Source # 
Instance details

Defined in Hasql.Interpolate.Internal.TH

Methods

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

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

data SqlBuilderExp Source #

Constructors

Sbe'Var Int 
Sbe'Param 
Sbe'Quote String 
Sbe'Ident String 
Sbe'DollarQuote String String 
Sbe'Cquote String 
Sbe'Sql String 

Instances

Instances details
Show SqlBuilderExp Source # 
Instance details

Defined in Hasql.Interpolate.Internal.TH

Methods

showsPrec :: Int -> SqlBuilderExp -> ShowS

show :: SqlBuilderExp -> String

showList :: [SqlBuilderExp] -> ShowS

Eq SqlBuilderExp Source # 
Instance details

Defined in Hasql.Interpolate.Internal.TH

data ParamEncoder Source #

Constructors

Pe'Exp Exp 
Pe'Var Int 

Instances

Instances details
Show ParamEncoder Source # 
Instance details

Defined in Hasql.Interpolate.Internal.TH

Methods

showsPrec :: Int -> ParamEncoder -> ShowS

show :: ParamEncoder -> String

showList :: [ParamEncoder] -> ShowS

Eq ParamEncoder Source # 
Instance details

Defined in Hasql.Interpolate.Internal.TH

Methods

(==) :: ParamEncoder -> ParamEncoder -> Bool

(/=) :: ParamEncoder -> ParamEncoder -> Bool

data SpliceBind Source #

Constructors

SpliceBind 

Fields

Instances

Instances details
Show SpliceBind Source # 
Instance details

Defined in Hasql.Interpolate.Internal.TH

Methods

showsPrec :: Int -> SpliceBind -> ShowS

show :: SpliceBind -> String

showList :: [SpliceBind] -> ShowS

Eq SpliceBind Source # 
Instance details

Defined in Hasql.Interpolate.Internal.TH

Methods

(==) :: SpliceBind -> SpliceBind -> Bool

(/=) :: SpliceBind -> SpliceBind -> Bool