Safe Haskell | None |
---|---|
Language | Haskell2010 |
Documentation
sql :: QuasiQuoter Source #
Allows SQL parameters interpolation from a SQL query. Only quoteExp
is
implemented because this quote can only be used at the expression level.
select_some_stuff :: Text -> Int -> Query select_some_stuff name age = [sql|select * from user where age = $age AND name = $name|]
In this case, sql
quote will generate the code below:
"select * from user where age = "<>
toSql
age<>
" AND name = "<>
toSql
name
sqlFile :: FilePath -> Q Exp Source #
Loads the content of a SQL query file and allows SQL parameters interpolation from it.
select_some_stuff :: Text -> Int -> Query select_some_stuff name age = $(sqlFile "path/to/my/sql/file.sql")
See sql
for more details.
partsParser :: Parser [Part] Source #