hssqlppp-0.5.18: SQL parser and type checker

Safe HaskellNone
LanguageHaskell2010

Database.HsSqlPpp.TypeChecker

Contents

Description

Contains functions for typechecking sql asts.

Synopsis

typechecking/ annotation functions

typeCheckStatements :: TypeCheckingFlags -> Catalog -> [Statement] -> (Catalog, [Statement])

Typechecks the ast, and returns the updated catalog (which includes changes from any ddl statements in the ast).

typeCheckParameterizedStatement :: TypeCheckingFlags -> Catalog -> Statement -> Either String Statement

Not working yet. Typechecks a statement possibly containing ? placeholders. These are annotated with the 'inferred type', and the stType annotation on the return value can be used to get this info easily. Returns Left if the statement is not a query,insert,update or delete statement

data TypeCheckingFlags

some options when typechecking

Constructors

TypeCheckingFlags 

Fields

tcfAddQualifiers :: Bool

add qualifiers to unqualified ids where possible

tcfAddFullTablerefAliases :: Bool

add full aliases to every tableref and subselect

tcfAddSelectItemAliases :: Bool

add explicit aliases to all select items

tcfExpandStars :: Bool

expand stars in select lists to explicit list columns

tcfDialect :: SQLSyntaxDialect
 

defaultTypeCheckingFlags :: TypeCheckingFlags

reasonable defaults for type checking, doesn't add anything optional