hssqlppp-0.0.10: Sql parser and type checkerSource codeContentsIndex
Database.HsSqlPpp.Ast.Ast
Contents
Main nodes
Components
Selects
dml
ddl
functions
typedefs
Description
This module contains the ast node data types. They are very permissive, in that they allow a lot of invalid SQL to be represented. The type checking process should catch all invalid trees, but doesn't quite manage at the moment. Sorry about all the seemingly pointless type synonyms below, they are an artefact of using UUAGC.
Synopsis
type StatementList = [Statement]
data Statement
= Assignment Annotation String Expression
| CaseStatement Annotation Expression ExpressionListStatementListPairList StatementList
| ContinueStatement Annotation
| Copy Annotation String StringList CopySource
| CopyData Annotation String
| CreateDomain Annotation String TypeName MaybeBoolExpression
| CreateFunction Annotation Language String ParamDefList TypeName String FnBody Volatility
| CreateTable Annotation String AttributeDefList ConstraintList
| CreateTableAs Annotation String SelectExpression
| CreateType Annotation String TypeAttributeDefList
| CreateView Annotation String SelectExpression
| Delete Annotation String MaybeBoolExpression (Maybe SelectList)
| DropFunction Annotation IfExists StringStringListPairList Cascade
| DropSomething Annotation DropType IfExists StringList Cascade
| Execute Annotation Expression
| ExecuteInto Annotation Expression StringList
| ForIntegerStatement Annotation String Expression Expression StatementList
| ForSelectStatement Annotation String SelectExpression StatementList
| If Annotation ExpressionStatementListPairList StatementList
| Insert Annotation String StringList SelectExpression (Maybe SelectList)
| NullStatement Annotation
| Perform Annotation Expression
| Raise Annotation RaiseType String ExpressionList
| Return Annotation MaybeExpression
| ReturnNext Annotation Expression
| ReturnQuery Annotation SelectExpression
| SelectStatement Annotation SelectExpression
| Truncate Annotation StringList RestartIdentity Cascade
| Update Annotation String SetClauseList MaybeBoolExpression (Maybe SelectList)
| WhileStatement Annotation Expression StatementList
data Expression
= BooleanLit Annotation Bool
| Case Annotation CaseExpressionListExpressionPairList MaybeExpression
| CaseSimple Annotation Expression CaseExpressionListExpressionPairList MaybeExpression
| Cast Annotation Expression TypeName
| Exists Annotation SelectExpression
| FloatLit Annotation Double
| FunCall Annotation String ExpressionList
| Identifier Annotation String
| InPredicate Annotation Expression Bool InList
| IntegerLit Annotation Integer
| NullLit Annotation
| PositionalArg Annotation Integer
| ScalarSubQuery Annotation SelectExpression
| StringLit Annotation String String
| WindowFn Annotation Expression ExpressionList ExpressionList Direction
data SelectExpression
= CombineSelect Annotation CombineType SelectExpression SelectExpression
| Select Annotation Distinct SelectList TableRefList MaybeBoolExpression ExpressionList MaybeBoolExpression ExpressionDirectionPairList MaybeExpression MaybeExpression
| Values Annotation ExpressionListList
data SelectList = SelectList Annotation SelectItemList StringList
data SelectItem
= SelExp Annotation Expression
| SelectItem Annotation Expression String
data TableRef
= JoinedTref Annotation TableRef Natural JoinType TableRef OnExpr
| SubTref Annotation SelectExpression String
| Tref Annotation String
| TrefAlias Annotation String String
| TrefFun Annotation Expression
| TrefFunAlias Annotation Expression String
data JoinExpression
= JoinOn Annotation Expression
| JoinUsing Annotation StringList
data JoinType
= Cross
| FullOuter
| Inner
| LeftOuter
| RightOuter
data Natural
= Natural
| Unnatural
data CombineType
= Except
| Intersect
| Union
| UnionAll
data Direction
= Asc
| Desc
data Distinct
= Distinct
| Dupes
data InList
= InList Annotation ExpressionList
| InSelect Annotation SelectExpression
data SetClause
= RowSetClause Annotation StringList ExpressionList
| SetClause Annotation String Expression
data CopySource
= CopyFilename String
| Stdin
data RestartIdentity
= ContinueIdentity
| RestartIdentity
data AttributeDef = AttributeDef Annotation String TypeName MaybeExpression RowConstraintList
data RowConstraint
= NotNullConstraint Annotation
| NullConstraint Annotation
| RowCheckConstraint Annotation Expression
| RowPrimaryKeyConstraint Annotation
| RowReferenceConstraint Annotation String (Maybe String) Cascade Cascade
| RowUniqueConstraint Annotation
data Constraint
= CheckConstraint Annotation Expression
| PrimaryKeyConstraint Annotation StringList
| ReferenceConstraint Annotation StringList String StringList Cascade Cascade
| UniqueConstraint Annotation StringList
data TypeAttributeDef = TypeAttDef Annotation String TypeName
data TypeName
= ArrayTypeName Annotation TypeName
| PrecTypeName Annotation String Integer
| SetOfTypeName Annotation TypeName
| SimpleTypeName Annotation String
data DropType
= Domain
| Table
| Type
| View
data IfExists
= IfExists
| Require
data Cascade
= Cascade
| Restrict
data FnBody
= PlpgsqlFnBody Annotation VarDefList StatementList
| SqlFnBody Annotation StatementList
data ParamDef
= ParamDef Annotation String TypeName
| ParamDefTp Annotation TypeName
data VarDef = VarDef Annotation String TypeName (Maybe Expression)
data RaiseType
= RError
| RException
| RNotice
data Volatility
= Immutable
| Stable
| Volatile
data Language
= Plpgsql
| Sql
type ExpressionListStatementListPairList = [ExpressionListStatementListPair]
type ExpressionListStatementListPair = (ExpressionList, StatementList)
type ExpressionList = [Expression]
type StringList = [String]
type ParamDefList = [ParamDef]
type AttributeDefList = [AttributeDef]
type ConstraintList = [Constraint]
type TypeAttributeDefList = [TypeAttributeDef]
type StringStringListPairList = [StringStringListPair]
type StringStringListPair = (String, StringList)
type ExpressionStatementListPairList = [ExpressionStatementListPair]
type SetClauseList = [SetClause]
type CaseExpressionListExpressionPairList = [CaseExpressionListExpressionPair]
type MaybeExpression = Maybe Expression
type MaybeBoolExpression = Maybe Expression
type TableRefList = [TableRef]
type ExpressionListList = [ExpressionList]
type SelectItemList = [SelectItem]
type OnExpr = Maybe JoinExpression
type RowConstraintList = [RowConstraint]
type VarDefList = [VarDef]
type ExpressionStatementListPair = (Expression, StatementList)
type CaseExpressionListExpressionPair = (CaseExpressionList, Expression)
type CaseExpressionList = [Expression]
type ExpressionDirectionPair = (Expression, Direction)
type ExpressionDirectionPairList = [ExpressionDirectionPair]
Main nodes
type StatementList = [Statement]Source
data Statement Source
Constructors
Assignment Annotation String Expression
CaseStatement Annotation Expression ExpressionListStatementListPairList StatementList
ContinueStatement Annotation
Copy Annotation String StringList CopySource
CopyData Annotation String
CreateDomain Annotation String TypeName MaybeBoolExpression
CreateFunction Annotation Language String ParamDefList TypeName String FnBody Volatility
CreateTable Annotation String AttributeDefList ConstraintList
CreateTableAs Annotation String SelectExpression
CreateType Annotation String TypeAttributeDefList
CreateView Annotation String SelectExpression
Delete Annotation String MaybeBoolExpression (Maybe SelectList)
DropFunction Annotation IfExists StringStringListPairList Cascade
DropSomething Annotation DropType IfExists StringList Cascade
Execute Annotation Expression
ExecuteInto Annotation Expression StringList
ForIntegerStatement Annotation String Expression Expression StatementList
ForSelectStatement Annotation String SelectExpression StatementList
If Annotation ExpressionStatementListPairList StatementList
Insert Annotation String StringList SelectExpression (Maybe SelectList)
NullStatement Annotation
Perform Annotation Expression
Raise Annotation RaiseType String ExpressionList
Return Annotation MaybeExpression
ReturnNext Annotation Expression
ReturnQuery Annotation SelectExpression
SelectStatement Annotation SelectExpression
Truncate Annotation StringList RestartIdentity Cascade
Update Annotation String SetClauseList MaybeBoolExpression (Maybe SelectList)
WhileStatement Annotation Expression StatementList
show/hide Instances
data Expression Source
Constructors
BooleanLit Annotation Bool
Case Annotation CaseExpressionListExpressionPairList MaybeExpression
CaseSimple Annotation Expression CaseExpressionListExpressionPairList MaybeExpression
Cast Annotation Expression TypeName
Exists Annotation SelectExpression
FloatLit Annotation Double
FunCall Annotation String ExpressionList
Identifier Annotation String
InPredicate Annotation Expression Bool InList
IntegerLit Annotation Integer
NullLit Annotation
PositionalArg Annotation Integer
ScalarSubQuery Annotation SelectExpression
StringLit Annotation String String
WindowFn Annotation Expression ExpressionList ExpressionList Direction
show/hide Instances
data SelectExpression Source
Constructors
CombineSelect Annotation CombineType SelectExpression SelectExpression
Select Annotation Distinct SelectList TableRefList MaybeBoolExpression ExpressionList MaybeBoolExpression ExpressionDirectionPairList MaybeExpression MaybeExpression
Values Annotation ExpressionListList
show/hide Instances
Components
Selects
data SelectList Source
Constructors
SelectList Annotation SelectItemList StringList
show/hide Instances
data SelectItem Source
Constructors
SelExp Annotation Expression
SelectItem Annotation Expression String
show/hide Instances
data TableRef Source
Constructors
JoinedTref Annotation TableRef Natural JoinType TableRef OnExpr
SubTref Annotation SelectExpression String
Tref Annotation String
TrefAlias Annotation String String
TrefFun Annotation Expression
TrefFunAlias Annotation Expression String
show/hide Instances
data JoinExpression Source
Constructors
JoinOn Annotation Expression
JoinUsing Annotation StringList
show/hide Instances
data JoinType Source
Constructors
Cross
FullOuter
Inner
LeftOuter
RightOuter
show/hide Instances
data Natural Source
Constructors
Natural
Unnatural
show/hide Instances
data CombineType Source
Constructors
Except
Intersect
Union
UnionAll
show/hide Instances
data Direction Source
Constructors
Asc
Desc
show/hide Instances
data Distinct Source
Constructors
Distinct
Dupes
show/hide Instances
data InList Source
Constructors
InList Annotation ExpressionList
InSelect Annotation SelectExpression
show/hide Instances
dml
data SetClause Source
Constructors
RowSetClause Annotation StringList ExpressionList
SetClause Annotation String Expression
show/hide Instances
data CopySource Source
Constructors
CopyFilename String
Stdin
show/hide Instances
data RestartIdentity Source
Constructors
ContinueIdentity
RestartIdentity
show/hide Instances
ddl
data AttributeDef Source
Constructors
AttributeDef Annotation String TypeName MaybeExpression RowConstraintList
show/hide Instances
data RowConstraint Source
Constructors
NotNullConstraint Annotation
NullConstraint Annotation
RowCheckConstraint Annotation Expression
RowPrimaryKeyConstraint Annotation
RowReferenceConstraint Annotation String (Maybe String) Cascade Cascade
RowUniqueConstraint Annotation
show/hide Instances
data Constraint Source
Constructors
CheckConstraint Annotation Expression
PrimaryKeyConstraint Annotation StringList
ReferenceConstraint Annotation StringList String StringList Cascade Cascade
UniqueConstraint Annotation StringList
show/hide Instances
data TypeAttributeDef Source
Constructors
TypeAttDef Annotation String TypeName
show/hide Instances
data TypeName Source
Constructors
ArrayTypeName Annotation TypeName
PrecTypeName Annotation String Integer
SetOfTypeName Annotation TypeName
SimpleTypeName Annotation String
show/hide Instances
data DropType Source
Constructors
Domain
Table
Type
View
show/hide Instances
data IfExists Source
Constructors
IfExists
Require
show/hide Instances
data Cascade Source
Constructors
Cascade
Restrict
show/hide Instances
functions
data FnBody Source
Constructors
PlpgsqlFnBody Annotation VarDefList StatementList
SqlFnBody Annotation StatementList
show/hide Instances
data ParamDef Source
Constructors
ParamDef Annotation String TypeName
ParamDefTp Annotation TypeName
show/hide Instances
data VarDef Source
Constructors
VarDef Annotation String TypeName (Maybe Expression)
show/hide Instances
data RaiseType Source
Constructors
RError
RException
RNotice
show/hide Instances
data Volatility Source
Constructors
Immutable
Stable
Volatile
show/hide Instances
data Language Source
Constructors
Plpgsql
Sql
show/hide Instances
typedefs
type ExpressionListStatementListPairList = [ExpressionListStatementListPair]Source
type ExpressionListStatementListPair = (ExpressionList, StatementList)Source
type ExpressionList = [Expression]Source
type StringList = [String]Source
type ParamDefList = [ParamDef]Source
type AttributeDefList = [AttributeDef]Source
type ConstraintList = [Constraint]Source
type TypeAttributeDefList = [TypeAttributeDef]Source
type StringStringListPairList = [StringStringListPair]Source
type StringStringListPair = (String, StringList)Source
type ExpressionStatementListPairList = [ExpressionStatementListPair]Source
type SetClauseList = [SetClause]Source
type CaseExpressionListExpressionPairList = [CaseExpressionListExpressionPair]Source
type MaybeExpression = Maybe ExpressionSource
type MaybeBoolExpression = Maybe ExpressionSource
type TableRefList = [TableRef]Source
type ExpressionListList = [ExpressionList]Source
type SelectItemList = [SelectItem]Source
type OnExpr = Maybe JoinExpressionSource
type RowConstraintList = [RowConstraint]Source
type VarDefList = [VarDef]Source
type ExpressionStatementListPair = (Expression, StatementList)Source
type CaseExpressionListExpressionPair = (CaseExpressionList, Expression)Source
type CaseExpressionList = [Expression]Source
type ExpressionDirectionPair = (Expression, Direction)Source
type ExpressionDirectionPairList = [ExpressionDirectionPair]Source
Produced by Haddock version 2.6.0