Safe Haskell | None |
---|---|
Language | Haskell2010 |
Hasql.Interpolate.Internal.TH
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 #
Constructors
SqlExpr | |
Fields
|
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
Eq SqlBuilderExp Source # | |
Defined in Hasql.Interpolate.Internal.TH Methods (==) :: SqlBuilderExp -> SqlBuilderExp -> Bool # (/=) :: SqlBuilderExp -> SqlBuilderExp -> Bool # | |
Show SqlBuilderExp Source # | |
Defined in Hasql.Interpolate.Internal.TH Methods showsPrec :: Int -> SqlBuilderExp -> ShowS # show :: SqlBuilderExp -> String # showList :: [SqlBuilderExp] -> ShowS # |
data ParamEncoder Source #
Instances
Eq ParamEncoder Source # | |
Defined in Hasql.Interpolate.Internal.TH | |
Show ParamEncoder Source # | |
Defined in Hasql.Interpolate.Internal.TH Methods showsPrec :: Int -> ParamEncoder -> ShowS # show :: ParamEncoder -> String # showList :: [ParamEncoder] -> ShowS # |
data SpliceBind Source #
Constructors
SpliceBind | |
Instances
Eq SpliceBind Source # | |
Defined in Hasql.Interpolate.Internal.TH | |
Show SpliceBind Source # | |
Defined in Hasql.Interpolate.Internal.TH Methods showsPrec :: Int -> SpliceBind -> ShowS # show :: SpliceBind -> String # showList :: [SpliceBind] -> ShowS # |