Safe Haskell | None |
---|---|
Language | Haskell2010 |
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 {}
Main
:: String | filename to use in errors |
-> String | a string containing the sql to parse |
-> Either ParseErrorExtra [Statement] |
parseStatementsFromFile Source
:: 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] Source
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 Source
Simple wrapper to allow showing the source context of a ParseError
ParseErrorExtra | |
|