Safe Haskell | None |
---|---|
Language | Haskell2010 |
- statementParser :: Parser (PrestoStatement RawNames Range)
- emptyParserScope :: ParserScope
- parse :: Text -> Either ParseError (PrestoStatement RawNames Range)
- parseAll :: Text -> Either ParseError (PrestoStatement RawNames Range)
- parseMany :: Text -> Either ParseError [PrestoStatement RawNames Range]
- parseManyAll :: Text -> Either ParseError [PrestoStatement RawNames Range]
- parseManyEithers :: Text -> Either ParseError [Either (Unparsed Range) (PrestoStatement RawNames Range)]
- statementP :: Parser (Statement Presto RawNames Range)
- queryP :: Parser (Query RawNames Range)
- queryNoWithP :: Parser (Query RawNames Range)
- querySelectP :: Parser (Query RawNames Range)
- selectP :: Parser (Select RawNames Range)
- distinctP :: Parser Distinct
- tableAliases :: Maybe (SelectFrom RawNames Range) -> Set Text
- tableNameToTableAlias :: OQTableName Range -> Set Text
- introduceAliases :: Set Text -> ParserScope -> ParserScope
- fromP :: Parser (SelectFrom RawNames Range)
- relationP :: Parser (Tablish RawNames Range)
- sampledRelationP :: Parser (Tablish RawNames Range)
- tableAliasP :: Parser (TableAlias Range)
- columnAliasP :: Parser (ColumnAlias Range)
- joinP :: Parser (Tablish RawNames Range -> Tablish RawNames Range)
- databaseNameP :: Parser (DatabaseName Range)
- unqualifiedSchemaNameP :: Parser (UQSchemaName Range)
- schemaNameP :: Parser (SchemaName RawNames Range)
- unqualifiedTableNameP :: Parser (UQTableName Range)
- tableNameP :: Parser (TableRef RawNames Range)
- unqualifiedColumnNameP :: Parser (UQColumnName Range)
- columnNameP :: Parser (ColumnRef RawNames Range)
- functionNameP :: Parser (FunctionName Range)
- selectStarP :: Parser (Selection RawNames Range)
- selectionP :: Integer -> Parser (Selection RawNames Range)
- countingSepBy1 :: (Integer -> Parser b) -> Parser c -> Parser [b]
- makeTableAlias :: Range -> Text -> Parser (TableAlias Range)
- makeColumnAlias :: Range -> Text -> Parser (ColumnAlias Range)
- makeDummyAlias :: Range -> Integer -> Parser (ColumnAlias Range)
- makeExprAlias :: Expr RawNames Range -> Integer -> Parser (ColumnAlias Range)
- unOpP :: Text -> Parser (Expr RawNames Range -> Expr RawNames Range)
- binOpP :: Text -> Parser (Expr RawNames Range -> Expr RawNames Range -> Expr RawNames Range)
- exprP :: Parser (Expr RawNames Range)
- orExprP :: Parser (Expr RawNames Range)
- andExprP :: Parser (Expr RawNames Range)
- notP :: Parser (Expr RawNames Range -> Expr RawNames Range)
- notExprP :: Parser (Expr RawNames Range)
- predicatedExprP :: Parser (Expr RawNames Range)
- valueExprP :: Parser (Expr RawNames Range)
- concatExprP :: Parser (Expr RawNames Range)
- sumExprP :: Parser (Expr RawNames Range)
- productExprP :: Parser (Expr RawNames Range)
- negateExprP :: Parser (Expr RawNames Range)
- intervalP :: Parser (Expr RawNames Range)
- atTimeZoneExprP :: Parser (Expr RawNames Range)
- stringConstantP :: Parser (Expr RawNames Range)
- primaryExprP :: Parser (Expr RawNames Range)
- extractPrimaryExprP :: Parser (Expr RawNames Range)
- normalizePrimaryExprP :: Parser (Expr RawNames Range)
- substringPrimaryExprP :: Parser (Expr RawNames Range)
- bareFuncPrimaryExprP :: Parser (Expr RawNames Range)
- arrayPrimaryExprP :: Parser (Expr RawNames Range)
- dataTypeP :: Parser (DataType Range)
- castPrimaryExprP :: Parser (Expr RawNames Range)
- casePrimaryExprP :: Parser (Expr RawNames Range)
- existsPrimaryExprP :: Parser (Expr RawNames Range)
- subqueryPrimaryExprP :: Parser (Expr RawNames Range)
- functionCallPrimaryExprP :: Parser (Expr RawNames Range)
- overP :: Parser (OverSubExpr RawNames Range)
- orderTopLevelP :: Parser (Range, [Order RawNames Range])
- orderInWindowClauseP :: Parser [Order RawNames Range]
- orderExprP :: Bool -> Bool -> Parser (Range, [Order RawNames Range])
- rowPrimaryExprP :: Parser (Expr RawNames Range)
- implicitRowPrimaryExprP :: Parser (Expr RawNames Range)
- positionPrimaryExprP :: Parser (Expr RawNames Range)
- parameterPrimaryExprP :: Parser (Expr RawNames Range)
- binaryLiteralPrimaryExprP :: Parser (Expr RawNames Range)
- constantPrimaryExprP :: Parser (Expr RawNames Range)
- numberExprP :: Parser (Expr RawNames Range)
- numberConstantP :: Parser (Constant Range)
- columnRefPrimaryExprP :: Parser (Expr RawNames Range)
- structAccessP :: Parser (Expr RawNames Range -> Expr RawNames Range)
- arrayAccessP :: Parser (Expr RawNames Range -> Expr RawNames Range)
- predicateP :: Parser (Expr RawNames Range -> Expr RawNames Range)
- optionalNotWrapper :: Parser (Expr RawNames Range -> Expr RawNames Range)
- isPredicateP :: Parser (Expr RawNames Range -> Expr RawNames Range)
- likePredicateP :: Parser (Expr RawNames Range -> Expr RawNames Range)
- inPredicateP :: Parser (Expr RawNames Range -> Expr RawNames Range)
- betweenPredicateP :: Parser (Expr RawNames Range -> Expr RawNames Range)
- quantifiedComparisonPredicateP :: Parser (Expr RawNames Range -> Expr RawNames Range)
- unquantifiedComparisonPredicateP :: Parser (Expr RawNames Range -> Expr RawNames Range)
- whereP :: Parser (SelectWhere RawNames Range)
- handlePositionalReferences :: Expr RawNames Range -> PositionOrExpr RawNames Range
- groupP :: Parser (SelectGroup RawNames Range)
- havingP :: Parser (SelectHaving RawNames Range)
- deleteP :: Parser (Delete RawNames Range)
- dropViewPrefixP :: Parser Range
- dropViewP :: Parser (DropView RawNames Range)
- dropTableP :: Parser (DropTable RawNames Range)
- ifExistsP :: Parser Range
- grantP :: Parser (Grant Range)
- revokeP :: Parser (Revoke Range)
- insertP :: Parser (Insert RawNames Range)
- explainP :: Parser Range
- showP :: Parser Range
- callP :: Parser Range
- describeP :: Parser Range
Documentation
parse :: Text -> Either ParseError (PrestoStatement RawNames Range) Source #
parse consumes a statement, or fails
parseAll :: Text -> Either ParseError (PrestoStatement RawNames Range) Source #
parseAll consumes all input as a single statement, or fails
parseMany :: Text -> Either ParseError [PrestoStatement RawNames Range] Source #
parseMany consumes multiple statements, or fails
parseManyAll :: Text -> Either ParseError [PrestoStatement RawNames Range] Source #
parseManyAll consumes all input multiple statements, or fails
parseManyEithers :: Text -> Either ParseError [Either (Unparsed Range) (PrestoStatement RawNames Range)] Source #
parseManyEithers consumes all input as multiple (statements or failures) it should never fail
tableAliases :: Maybe (SelectFrom RawNames Range) -> Set Text Source #
introduceAliases :: Set Text -> ParserScope -> ParserScope Source #
tableAliasP :: Parser (TableAlias Range) Source #
columnNameP :: Parser (ColumnRef RawNames Range) Source #
parsing of qualified columnNames respects the following rules:
1) you need to know what tablishes are in scope when parsing a column ref 2) column refs may only be as qualified as the table that introduced them 3) column refs are greedy w.r.t. dots (if a qualified table name and a CTE have the same prefix, a qualified column ref prefers the table)
If a scope is present (i.e. while parsing selections), the table name must be a member of the tableAlias list for the parser to succeed. Otherwise, the column parser fails and execution tries the next parser choice.
Should the scope not be set, e.g. when selectP is performing lookahead to build scope, this check is skipped.
makeTableAlias :: Range -> Text -> Parser (TableAlias Range) Source #
makeColumnAlias :: Range -> Text -> Parser (ColumnAlias Range) Source #
makeDummyAlias :: Range -> Integer -> Parser (ColumnAlias Range) Source #
makeExprAlias :: Expr RawNames Range -> Integer -> Parser (ColumnAlias Range) Source #