Functions to parse SQL.
- parseStatements :: String -> String -> Either ParseErrorExtra [Statement]
- parseStatementsWithPosition :: FilePath -> Int -> Int -> String -> Either ParseErrorExtra [Statement]
- parseStatementsFromFile :: FilePath -> IO (Either ParseErrorExtra [Statement])
- parseQueryExpr :: String -> String -> Either ParseErrorExtra QueryExpr
- parseScalarExpr :: String -> String -> Either ParseErrorExtra ScalarExpr
- parsePlpgsql :: String -> String -> Either ParseErrorExtra [Statement]
- data ParseErrorExtra = ParseErrorExtra {
- parseErrorError :: ParseError
- parseErrorPosition :: Maybe (Int, Int)
- parseErrorSqlSource :: String
Main
:: String | filename to use in errors |
-> String | a string containing the sql to parse |
-> Either ParseErrorExtra [Statement] |
:: FilePath | filename to use in errors |
-> Int | adjust line number in errors by adding this |
-> Int | adjust column in errors by adding this |
-> String | a string containing the sql to parse |
-> Either ParseErrorExtra [Statement] |
:: FilePath | file name of file containing sql |
-> IO (Either ParseErrorExtra [Statement]) |
:: String | filename to use in errors |
-> String | a string containing the sql to parse |
-> Either ParseErrorExtra QueryExpr |
Testing
:: String | filename for error messages |
-> String | sql string containing a single expression, with no trailing ';' |
-> Either ParseErrorExtra ScalarExpr |
Parse expression fragment, used for testing purposes
parsePlpgsql :: String -> String -> Either ParseErrorExtra [Statement]
Parse plpgsql statements, used for testing purposes - this can be used to parse a list of plpgsql statements which aren't contained in a create function. (The produced ast won't pass a type check.)
errors
data ParseErrorExtra
Simple wrapper to allow showing the source context of a ParseError
ParseErrorExtra | |
|