| Safe Haskell | Safe |
|---|---|
| Language | Haskell2010 |
SQLParser
Description
Synopsis
- data SQLExpr
- data ResType
- sqlExpr :: Parser SQLExpr
- evaluateSQL :: Either ParseError SQLExpr -> ResType -> ResType
- getHeaders :: [(Int, String, Datatype, String)] -> String
- getRow :: [(Int, String, Datatype, String)] -> String
- getRows :: [[(Int, String, Datatype, String)]] -> IO ()
- queryPrinter :: ResType -> IO ()
Documentation
SQLExpr is a wrapping type constructor for Select, Insert and Delete statements.
'SELECT QueryExpr' contains
Constructors
| SELECT QueryExpr | Parses a SELECT query |
| INSERT InsertExpr | Parses a INSERT Query |
| CREATE CreateExpr | Parses a CREATE Query |
| DELETE DeleteExpr | Parses a DELETE Query |
ResType is a wrapping type constructor for the response types of each of the above statements.
evaluateSQL :: Either ParseError SQLExpr -> ResType -> ResType Source #
evaluateSQL evaluates each Expression using individual case statements
getHeaders :: [(Int, String, Datatype, String)] -> String Source #
getHeader returns string of headers of table
First argument is list of headers
getRow :: [(Int, String, Datatype, String)] -> String Source #
getHeader returns string of depicting one entire row
First argument is a row
getRows :: [[(Int, String, Datatype, String)]] -> IO () Source #
getRows prints the rows which are the output of select query
The argument is output of select parsed query
queryPrinter :: ResType -> IO () Source #
queryPrinter prints the Select query output in a tabular fashion
The argument is output of select parsed query