hssqlppp-0.4.0: SQL parser and type checker




Contains the annotation data types and a few auxiliary functions.


Annotation data types

data Annotation Source

Annotation type - one of these is attached to most of the data types used in the ast.




asrc :: Maybe SourcePosition

source position for this node

atype :: Maybe Type

type of the node, Nothing if the tree hasn't been typechecked or if a type error prevents determining the type

errs :: [TypeError]

any type errors

stType :: Maybe ParameterizedStatementType

used for getting the in and out types of a parameterized statement

catUpd :: [CatalogUpdate]

any catalog updates that a ddl statement produces

fnProt :: Maybe FunctionPrototype

the matched function prototype for a funcall

infType :: Maybe Type

inferred type - fake type inference used for getting the type of ? placeholders in parameterized statements

type SourcePosition = (String, Int, Int)Source

Represents a source file position, usually set by the parser.

type ParameterizedStatementType = ([Type], [(String, Type)])Source

Statement type is used for getting type information for a parameterized statement.

getAnnotation :: Data a => a -> AnnotationSource

get the annotation for the root element of the tree passed

updateAnnotation :: Data a => (Annotation -> Annotation) -> a -> aSource

Update the first annotation in a tree using the function supplied

emptyAnnotation :: AnnotationSource

An annotation value with no information.