hssqlppp-0.4.1: SQL parser and type checker

Safe HaskellNone
LanguageHaskell98

Database.HsSqlPpp.Quote

Description

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

Synopsis

Documentation

sqlStmts :: QuasiQuoter Source

quotes Statements

sqlStmt :: QuasiQuoter Source

quotes a single Statement

pgsqlStmts :: QuasiQuoter Source

quotes plpgsql Statements

pgsqlStmt :: QuasiQuoter Source

quotes a plpgsql Statement

sqlExpr :: QuasiQuoter Source

quotes a ScalarExpr