Safe Haskell | None |
---|---|
Language | Haskell98 |
A quasiquoter for SQL. Antiquoting is a bit inconsistent. The splice variable names must be all lower case because of a limitation in the parser.
Example:
import Database.HsSqlPpp.Ast import Database.HsSqlPpp.Quote import Database.HsSqlPpp.Annotation test :: Statement test = [$sqlStmt| create table $(tablename) ( $(varname) $(typename) ); |] where tablename = "my_table" varname = "my_field" typename = "text"
See http://jakewheat.github.com/hssqlppp/QuasiQuoteTests.html for more simple examples
Documentation
sqlStmts :: QuasiQuoter Source
quotes Statements
quotes a single Statement
pgsqlStmts :: QuasiQuoter Source
quotes plpgsql Statements
pgsqlStmt :: QuasiQuoter Source
quotes a plpgsql Statement
quotes a ScalarExpr