Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Synopsis
- sql :: QuasiQuoter
- addParam :: State Int Builder
- parseSqlExpr :: String -> Either (ParseErrorBundle String Void) SqlExpr
- compileSqlExpr :: SqlExpr -> Q Exp
- data SqlExpr = SqlExpr {
- sqlBuilderExp :: [SqlBuilderExp]
- paramEncoder :: [ParamEncoder]
- spliceBinds :: [SpliceBind]
- bindCount :: Int
- data SqlBuilderExp
- data ParamEncoder
- data SpliceBind = SpliceBind {}
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 |]
parseSqlExpr :: String -> Either (ParseErrorBundle String Void) SqlExpr Source #
SqlExpr | |
|
data SqlBuilderExp Source #
Sbe'Var Int | |
Sbe'Param | |
Sbe'Quote String | |
Sbe'Ident String | |
Sbe'DollarQuote String String | |
Sbe'Cquote String | |
Sbe'Sql String |
Instances
Show SqlBuilderExp Source # | |
Defined in Hasql.Interpolate.Internal.TH | |
Eq SqlBuilderExp Source # | |
Defined in Hasql.Interpolate.Internal.TH (==) :: SqlBuilderExp -> SqlBuilderExp -> Bool Source # (/=) :: SqlBuilderExp -> SqlBuilderExp -> Bool Source # |
data ParamEncoder Source #
Instances
Show ParamEncoder Source # | |
Defined in Hasql.Interpolate.Internal.TH | |
Eq ParamEncoder Source # | |
Defined in Hasql.Interpolate.Internal.TH (==) :: ParamEncoder -> ParamEncoder -> Bool Source # (/=) :: ParamEncoder -> ParamEncoder -> Bool Source # |
data SpliceBind Source #
Instances
Show SpliceBind Source # | |
Defined in Hasql.Interpolate.Internal.TH | |
Eq SpliceBind Source # | |
Defined in Hasql.Interpolate.Internal.TH (==) :: SpliceBind -> SpliceBind -> Bool Source # (/=) :: SpliceBind -> SpliceBind -> Bool Source # |