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