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.
- printStatements :: StatementList -> String
- printStatementsAnn :: (Annotation -> String) -> StatementList -> String
- printQueryExpr :: QueryExpr -> String
- printScalarExpr :: ScalarExpr -> String
- printQueryExprNice :: QueryExpr -> String
Documentation
printStatements :: StatementList -> String
convert an ast back to valid SQL source, it's also almost human readable.
printStatementsAnn :: (Annotation -> String) -> StatementList -> String
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.
printQueryExpr :: QueryExpr -> String
printScalarExpr :: ScalarExpr -> String
Testing function, pretty print an expression
printQueryExprNice :: QueryExpr -> String
Try harder to make the output human readable, not necessary correct sql output at the moment