Safe Haskell | None |
---|---|
Language | Haskell2010 |
Functions to parse SQL.
- parseStatements :: 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
- parsePlpgsql :: ParseFlags -> FilePath -> Maybe (Int, Int) -> Text -> Either ParseErrorExtra [Statement]
- data ParseFlags = ParseFlags {}
- defaultParseFlags :: ParseFlags
- data SQLSyntaxDialect
- data ParseErrorExtra = ParseErrorExtra {
- parseErrorError :: ParseError
- parseErrorPosition :: Maybe (Int, Int)
- parseErrorSqlSource :: Text
- 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 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
:: 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 plpgsql statements (or tsql if you are using sql server dialect)
Parsing options
data ParseFlags
Settings to influence the parsing
data SQLSyntaxDialect
The dialect of SQL to use.
errors
data ParseErrorExtra
Simple wrapper to allow showing the source context of a ParseError
ParseErrorExtra | |
|
internals
parseName :: ParseFlags -> FilePath -> Maybe (Int, Int) -> Text -> Either ParseErrorExtra Name
parseNameComponent :: ParseFlags -> FilePath -> Maybe (Int, Int) -> Text -> Either ParseErrorExtra NameComponent