hssqlppp-0.4.1: SQL parser and type checker

Safe HaskellNone
LanguageHaskell98

Database.HsSqlPpp.Pretty

Description

Functions to convert sql asts to valid SQL source code. Includes a function - printSqlAnn - to output the annotations from a tree in comments in the outputted SQL source.

Produces sort of readable code, but mainly just written to produce reparsable text. Could do with some work to make the outputted text layout better.

Synopsis

Documentation

printStatements :: StatementList -> String Source

convert an ast back to valid SQL source, it's also almost human readable.

printStatementsAnn :: (Annotation -> String) -> StatementList -> String Source

convert the ast back to valid source, and convert any annotations to text using the function provided and interpolate the output of this function(inside comments) with the SQL source.

printScalarExpr :: ScalarExpr -> String Source

Testing function, pretty print an expression

printQueryExprNice :: QueryExpr -> String Source

Try harder to make the output human readable, not necessary correct sql output at the moment