hssqlppp-0.4.0: SQL parser and type checker

Database.HsSqlPpp.Ast

Contents

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. You can see labels for the fields by looking at the ag source here: http://jakewheat.github.com/hssqlppp/source/src/Database/HsSqlPpp/Internals/AstInternal.ag.html

Synopsis

Main nodes

data Statement

Constructors

AlterSequence Annotation Name Name 
AlterTable Annotation Name AlterTableActionList 
AntiStatement String 
Assignment Annotation Name ScalarExpr 
Block Annotation (Maybe String) VarDefList StatementList 
CaseStatement Annotation ScalarExprListStatementListPairList StatementList 
CaseStatementSimple Annotation ScalarExpr ScalarExprListStatementListPairList StatementList 
ContinueStatement Annotation (Maybe String) 
Copy Annotation Name [NameComponent] CopySource 
CopyData Annotation String 
CreateDomain Annotation Name TypeName String MaybeBoolExpr 
CreateFunction Annotation Name ParamDefList TypeName Replace Language FnBody Volatility 
CreateLanguage Annotation String 
CreateSequence Annotation Name Integer Integer Integer Integer Integer 
CreateTable Annotation Name AttributeDefList ConstraintList 
CreateTableAs Annotation Name QueryExpr 
CreateTrigger Annotation NameComponent TriggerWhen [TriggerEvent] Name TriggerFire Name ScalarExprList 
CreateType Annotation Name TypeAttributeDefList 
CreateView Annotation Name MaybeNameComponentList QueryExpr 
Delete Annotation Name TableRefList MaybeBoolExpr MaybeSelectList 
DropFunction Annotation IfExists NameTypeNameListPairList Cascade 
DropSomething Annotation DropType IfExists [Name] Cascade 
Execute Annotation ScalarExpr 
ExitStatement Annotation (Maybe String) 
ForIntegerStatement Annotation (Maybe String) NameComponent ScalarExpr ScalarExpr StatementList 
ForQueryStatement Annotation (Maybe String) NameComponent QueryExpr StatementList 
If Annotation ScalarExprStatementListPairList StatementList 
Insert Annotation Name [NameComponent] QueryExpr MaybeSelectList 
Into Annotation Bool [Name] Statement 
LoopStatement Annotation (Maybe String) StatementList 
Notify Annotation String 
NullStatement Annotation 
Perform Annotation ScalarExpr 
QueryStatement Annotation QueryExpr 
Raise Annotation RaiseType String ScalarExprList 
Return Annotation MaybeScalarExpr 
ReturnNext Annotation ScalarExpr 
ReturnQuery Annotation QueryExpr 
Set Annotation String [SetValue] 
Truncate Annotation [Name] RestartIdentity Cascade 
Update Annotation Name SetClauseList TableRefList MaybeBoolExpr MaybeSelectList 
WhileStatement Annotation (Maybe String) ScalarExpr StatementList 

Components

Selects

data Natural

Constructors

Natural 
Unnatural 

data CombineType

Constructors

Except 
Union 
Intersect 
UnionAll 

data Direction

Constructors

Asc 
Desc 

data Distinct

Constructors

Distinct 
Dupes 

data LiftFlavour

Constructors

LiftAny 
LiftAll 

data Name

Constructors

Name Annotation [NameComponent] 

data NameComponent

Constructors

Nmc String 
QNmc String 

ncStr :: NameComponent -> String

dml

data CopySource

Constructors

CopyFilename String 
Stdin 

ddl

data DropType

Constructors

Table 
Domain 
View 
Type 

data IfExists

Constructors

Require 
IfExists 

data Replace

Constructors

Replace 
NoReplace 

data Cascade

Constructors

Cascade 
Restrict 

data TriggerEvent

Constructors

TInsert 
TUpdate 
TDelete 
AntiTriggerEvent String 

data TriggerFire

Constructors

EachRow 
EachStatement 

functions

data RaiseType

Constructors

RNotice 
RException 
RError 

data Volatility

Constructors

Volatile 
Stable 
Immutable 

data Language

Constructors

Sql 
Plpgsql 

misc

data SetValue

Constructors

SetStr Annotation String 
SetId Annotation String 
SetNum Annotation Double 

typedefs

type OnExpr = Maybe JoinExpr