Safe Haskell | None |
---|---|
Language | Haskell2010 |
Functions to parse SQL.
- parseStatements :: ParseFlags -> FilePath -> Maybe (Int, Int) -> Text -> Either ParseErrorExtra [Statement]
- parseProcSQL :: ParseFlags -> FilePath -> Maybe (Int, Int) -> Text -> Either ParseErrorExtra [Statement]
- parseQueryExpr :: ParseFlags -> FilePath -> Maybe (Int, Int) -> Text -> Either ParseErrorExtra QueryExpr
- parseScalarExpr :: ParseFlags -> FilePath -> Maybe (Int, Int) -> Text -> Either ParseErrorExtra ScalarExpr
- data ParseFlags = ParseFlags {}
- defaultParseFlags :: ParseFlags
- data Dialect = Dialect {
- diName :: String
- diSyntaxFlavour :: SyntaxFlavour
- diCanonicalTypeNames :: [(Text, [Text])]
- diTextTypes :: [Text]
- diDatetimeTypes :: [Text]
- diNumberTypes :: [Text]
- namesForAnsiTypes :: [(Text, Text)]
- diDefaultCatalog :: Catalog
- ansiDialect :: Dialect
- data ParseErrorExtra = ParseErrorExtra {}
- parseName :: ParseFlags -> FilePath -> Maybe (Int, Int) -> Text -> Either ParseErrorExtra Name
- parseNameComponent :: ParseFlags -> FilePath -> Maybe (Int, Int) -> Text -> Either ParseErrorExtra NameComponent
Main
:: ParseFlags | parse options |
-> FilePath | filename to use in errors |
-> Maybe (Int, Int) | set the line number and column number of the first char in the source (used in annotation) |
-> Text | a string containing the sql to parse |
-> Either ParseErrorExtra [Statement] |
Parse a list of statements
:: ParseFlags | parse options |
-> FilePath | filename to use in errors |
-> Maybe (Int, Int) | set the line number and column number |
-> Text | a string containing the sql to parse |
-> Either ParseErrorExtra [Statement] |
Parse a list of procedural sql statements
:: ParseFlags | parse options |
-> FilePath | filename to use in errors |
-> Maybe (Int, Int) | set the line number and column number |
-> Text | a string containing the sql to parse |
-> Either ParseErrorExtra QueryExpr |
Parse a single query expr
:: ParseFlags | parse options |
-> FilePath | filename to use in errors |
-> Maybe (Int, Int) | set the line number and column number |
-> Text | a string containing the sql to parse |
-> Either ParseErrorExtra ScalarExpr |
Parse a single scalar expr
Parsing options
data ParseFlags Source
Settings to influence the parsing
Dialect | |
|
errors
data ParseErrorExtra Source
Simple wrapper to allow showing the source context of a ParseError
ParseErrorExtra | |
|
internals
parseName :: ParseFlags -> FilePath -> Maybe (Int, Int) -> Text -> Either ParseErrorExtra Name Source
parseNameComponent :: ParseFlags -> FilePath -> Maybe (Int, Int) -> Text -> Either ParseErrorExtra NameComponent Source