HaSSQL-1.0.0: Haskell Simple Structured Query Language

Safe HaskellSafe
LanguageHaskell2010

SQLParser

Description

 
Synopsis

Documentation

data SQLExpr Source #

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

Instances
Eq SQLExpr Source # 
Instance details

Defined in SQLParser

Methods

(==) :: SQLExpr -> SQLExpr -> Bool #

(/=) :: SQLExpr -> SQLExpr -> Bool #

Show SQLExpr Source # 
Instance details

Defined in SQLParser

data ResType Source #

ResType is a wrapping type constructor for the response types of each of the above statements.

Constructors

DB (Maybe Database)

Database instance for insert, create and delete queries

OUT [[(Int, String, Datatype, String)]]

Return object for SELECT queries

ERROR String 
Instances
Eq ResType Source # 
Instance details

Defined in SQLParser

Methods

(==) :: ResType -> ResType -> Bool #

(/=) :: ResType -> ResType -> Bool #

Show ResType Source # 
Instance details

Defined in SQLParser

sqlExpr :: Parser SQLExpr Source #

sqlExpr describes an SQL expression.

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