Safe Haskell | None |
---|---|
Language | Haskell2010 |
Contains functions for typechecking sql asts.
- typeCheckStatements :: TypeCheckFlags -> Catalog -> [Statement] -> (Catalog, [Statement])
- typeCheckQueryExpr :: TypeCheckFlags -> Catalog -> QueryExpr -> QueryExpr
- typeCheckScalarExpr :: TypeCheckFlags -> Catalog -> Environment -> ScalarExpr -> ScalarExpr
- data TypeCheckFlags = TypeCheckFlags {}
- data Dialect = Dialect {
- diName :: String
- diSyntaxFlavour :: SyntaxFlavour
- diCanonicalTypeNames :: [(Text, [Text])]
- diTextTypes :: [Text]
- diDatetimeTypes :: [Text]
- diNumberTypes :: [Text]
- namesForAnsiTypes :: [(Text, Text)]
- diDefaultCatalog :: Catalog
- ansiDialect :: Dialect
- defaultTypeCheckFlags :: TypeCheckFlags
- emptyEnvironment :: Environment
typechecking/ annotation functions
typeCheckStatements :: TypeCheckFlags -> Catalog -> [Statement] -> (Catalog, [Statement]) Source
Typechecks the ast, and returns the updated catalog (which includes changes from any ddl statements in the ast).
typeCheckQueryExpr :: TypeCheckFlags -> Catalog -> QueryExpr -> QueryExpr Source
Typecheck a query expr
typeCheckScalarExpr :: TypeCheckFlags -> Catalog -> Environment -> ScalarExpr -> ScalarExpr Source
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 TypeCheckFlags Source
some options when typechecking
TypeCheckFlags | |
|
Dialect | |
|
defaultTypeCheckFlags :: TypeCheckFlags Source
reasonable defaults for type checking, doesn't add anything optional