queryparser-presto-0.1.0.1: Parsing for Presto SQL queries

Safe HaskellNone
LanguageHaskell2010

Database.Sql.Presto.Parser

Synopsis

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

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.