Struct mz_sql_parser::parser::Parser
source · struct Parser<'a> {
sql: &'a str,
tokens: Vec<PosToken>,
index: usize,
recursion_guard: RecursionGuard,
}
Expand description
SQL Parser
Fields§
§sql: &'a str
§tokens: Vec<PosToken>
§index: usize
The index of the first unprocessed token in self.tokens
recursion_guard: RecursionGuard
Implementations§
source§impl<'a> Parser<'a>
impl<'a> Parser<'a>
fn error(&self, pos: usize, message: String) -> ParserError
fn parse_statements( &mut self, ) -> Result<Vec<StatementParseResult<'a>>, ParserStatementError>
sourcefn parse_statement(
&mut self,
) -> Result<StatementParseResult<'a>, ParserStatementError>
fn parse_statement( &mut self, ) -> Result<StatementParseResult<'a>, ParserStatementError>
Parse a single top-level statement (such as SELECT, INSERT, CREATE, etc.), stopping before the statement separator, if any. Returns the parsed statement and the SQL fragment corresponding to it.
sourcefn parse_statement_inner(
&mut self,
) -> Result<Statement<Raw>, ParserStatementError>
fn parse_statement_inner( &mut self, ) -> Result<Statement<Raw>, ParserStatementError>
Parse a single top-level statement (such as SELECT, INSERT, CREATE, etc.), stopping before the statement separator, if any.
sourcefn parse_expr(&mut self) -> Result<Expr<Raw>, ParserError>
fn parse_expr(&mut self) -> Result<Expr<Raw>, ParserError>
Parse a new expression
sourcefn parse_subexpr(
&mut self,
precedence: Precedence,
) -> Result<Expr<Raw>, ParserError>
fn parse_subexpr( &mut self, precedence: Precedence, ) -> Result<Expr<Raw>, ParserError>
Parse tokens until the precedence decreases
fn parse_subexpr_seeded( &mut self, precedence: Precedence, expr: Expr<Raw>, ) -> Result<Expr<Raw>, ParserError>
sourcefn parse_prefix(&mut self) -> Result<Expr<Raw>, ParserError>
fn parse_prefix(&mut self) -> Result<Expr<Raw>, ParserError>
Parse an expression prefix
sourcefn parse_parenthesized_fragment(
&mut self,
) -> Result<ParenthesizedFragment, ParserError>
fn parse_parenthesized_fragment( &mut self, ) -> Result<ParenthesizedFragment, ParserError>
Parses an expression list that appears in parentheses, like (1 + 1)
,
(SELECT 1)
, or (1, 2)
. Assumes that the opening parenthesis has
already been parsed. Parses up to the closing parenthesis without
consuming it.
fn parse_function( &mut self, name: RawItemName, ) -> Result<Function<Raw>, ParserError>
fn parse_window_frame(&mut self) -> Result<WindowFrame, ParserError>
sourcefn parse_window_frame_bound(&mut self) -> Result<WindowFrameBound, ParserError>
fn parse_window_frame_bound(&mut self) -> Result<WindowFrameBound, ParserError>
Parse CURRENT ROW
or { <positive number> | UNBOUNDED } { PRECEDING | FOLLOWING }
fn parse_case_expr(&mut self) -> Result<Expr<Raw>, ParserError>
sourcefn parse_cast_expr(&mut self) -> Result<Expr<Raw>, ParserError>
fn parse_cast_expr(&mut self) -> Result<Expr<Raw>, ParserError>
Parse a SQL CAST function e.g. CAST(expr AS FLOAT)
sourcefn parse_exists_expr(&mut self) -> Result<Expr<Raw>, ParserError>
fn parse_exists_expr(&mut self) -> Result<Expr<Raw>, ParserError>
Parse a SQL EXISTS expression e.g. WHERE EXISTS(SELECT ...)
.
fn parse_homogenizing_function( &mut self, function: HomogenizingFunction, ) -> Result<Expr<Raw>, ParserError>
fn parse_nullif_expr(&mut self) -> Result<Expr<Raw>, ParserError>
fn parse_extract_expr(&mut self) -> Result<Expr<Raw>, ParserError>
fn parse_row_expr(&mut self) -> Result<Expr<Raw>, ParserError>
fn parse_composite_type_definition( &mut self, ) -> Result<Vec<ColumnDef<Raw>>, ParserError>
fn parse_trim_expr(&mut self) -> Result<Expr<Raw>, ParserError>
fn parse_position_expr(&mut self) -> Result<Expr<Raw>, ParserError>
sourcefn parse_interval_value(&mut self) -> Result<IntervalValue, ParserError>
fn parse_interval_value(&mut self) -> Result<IntervalValue, ParserError>
Parse an INTERVAL literal.
Some syntactically valid intervals:
INTERVAL '1' DAY
INTERVAL '1-1' YEAR TO MONTH
INTERVAL '1' SECOND
- `INTERVAL ‘1:1’ MINUTE TO SECOND
INTERVAL '1:1:1.1' HOUR TO SECOND (5)
INTERVAL '1.111' SECOND (2)
sourcefn parse_infix(
&mut self,
expr: Expr<Raw>,
precedence: Precedence,
) -> Result<Expr<Raw>, ParserError>
fn parse_infix( &mut self, expr: Expr<Raw>, precedence: Precedence, ) -> Result<Expr<Raw>, ParserError>
Parse an operator following an expression
sourcefn parse_subscript(&mut self, expr: Expr<Raw>) -> Result<Expr<Raw>, ParserError>
fn parse_subscript(&mut self, expr: Expr<Raw>) -> Result<Expr<Raw>, ParserError>
Parse subscript expression, i.e. either an index value or slice range.
fn parse_substring_expr(&mut self) -> Result<Expr<Raw>, ParserError>
sourcefn parse_operator(&mut self) -> Result<Op, ParserError>
fn parse_operator(&mut self) -> Result<Op, ParserError>
Parse an operator reference.
Examples:
+
OPERATOR(schema.+)
OPERATOR("foo"."bar"."baz".@>)
sourcefn parse_any_all(
&mut self,
left: Expr<Raw>,
op: Op,
kw: Keyword,
) -> Result<Expr<Raw>, ParserError>
fn parse_any_all( &mut self, left: Expr<Raw>, op: Op, kw: Keyword, ) -> Result<Expr<Raw>, ParserError>
Parses an ANY
, ALL
, or SOME
operation, starting after the ANY
,
ALL
, or SOME
keyword.
sourcefn parse_in(
&mut self,
expr: Expr<Raw>,
negated: bool,
) -> Result<Expr<Raw>, ParserError>
fn parse_in( &mut self, expr: Expr<Raw>, negated: bool, ) -> Result<Expr<Raw>, ParserError>
Parses the parens following the [ NOT ] IN
operator
sourcefn parse_between(
&mut self,
expr: Expr<Raw>,
negated: bool,
) -> Result<Expr<Raw>, ParserError>
fn parse_between( &mut self, expr: Expr<Raw>, negated: bool, ) -> Result<Expr<Raw>, ParserError>
Parses BETWEEN <low> AND <high>
, assuming the BETWEEN
keyword was already consumed
sourcefn parse_like(
&mut self,
expr: Expr<Raw>,
case_insensitive: bool,
negated: bool,
) -> Result<Expr<Raw>, ParserError>
fn parse_like( &mut self, expr: Expr<Raw>, case_insensitive: bool, negated: bool, ) -> Result<Expr<Raw>, ParserError>
Parses LIKE <pattern> [ ESCAPE <char> ]
, assuming the LIKE
keyword was already consumed
sourcefn parse_pg_cast(&mut self, expr: Expr<Raw>) -> Result<Expr<Raw>, ParserError>
fn parse_pg_cast(&mut self, expr: Expr<Raw>) -> Result<Expr<Raw>, ParserError>
Parse a postgresql casting style which is in the form of expr::datatype
sourcefn get_next_precedence(&self) -> Precedence
fn get_next_precedence(&self) -> Precedence
Get the precedence of the next token
sourcefn peek_token(&self) -> Option<Token>
fn peek_token(&self) -> Option<Token>
Return the first non-whitespace token that has not yet been processed (or None if reached end-of-file)
fn peek_keyword(&self, kw: Keyword) -> bool
fn peek_keywords(&self, keywords: &[Keyword]) -> bool
fn peek_keywords_from(&self, start: usize, keywords: &[Keyword]) -> bool
fn peek_one_of_keywords(&self, kws: &[Keyword]) -> bool
sourcefn peek_keywords_lookahead(&self, keywords: &[Keyword]) -> bool
fn peek_keywords_lookahead(&self, keywords: &[Keyword]) -> bool
Returns whether the sequence of keywords is found at any point before the end of the unprocessed tokens.
sourcefn peek_nth_token(&self, n: usize) -> Option<Token>
fn peek_nth_token(&self, n: usize) -> Option<Token>
Return the nth token that has not yet been processed.
sourcefn next_token(&mut self) -> Option<Token>
fn next_token(&mut self) -> Option<Token>
Return the next token that has not yet been processed, or None if reached end-of-file, and mark it as processed. OK to call repeatedly after reaching EOF.
sourcefn prev_token(&mut self)
fn prev_token(&mut self)
Push back the last one non-whitespace token. Must be called after
next_token()
, otherwise might panic. OK to call after
next_token()
indicates an EOF.
sourcefn peek_pos(&self) -> usize
fn peek_pos(&self) -> usize
Return the byte position within the query string at which the next token starts.
sourcefn peek_prev_pos(&self) -> usize
fn peek_prev_pos(&self) -> usize
Return the byte position within the query string at which the previous token starts.
Must be called after next_token()
, otherwise might panic.
OK to call after next_token()
indicates an EOF.
sourcefn expected<D, T>(
&self,
pos: usize,
expected: D,
found: Option<Token>,
) -> Result<T, ParserError>where
D: Display,
fn expected<D, T>(
&self,
pos: usize,
expected: D,
found: Option<Token>,
) -> Result<T, ParserError>where
D: Display,
Report unexpected token
sourcefn parse_keyword(&mut self, kw: Keyword) -> bool
fn parse_keyword(&mut self, kw: Keyword) -> bool
Look for an expected keyword and consume it if it exists
sourcefn parse_keywords(&mut self, keywords: &[Keyword]) -> bool
fn parse_keywords(&mut self, keywords: &[Keyword]) -> bool
Look for an expected sequence of keywords and consume them if they exist
fn parse_at_most_one_keyword( &mut self, keywords: &[Keyword], location: &str, ) -> Result<Option<Keyword>, ParserError>
sourcefn parse_one_of_keywords(&mut self, kws: &[Keyword]) -> Option<Keyword>
fn parse_one_of_keywords(&mut self, kws: &[Keyword]) -> Option<Keyword>
Look for one of the given keywords and return the one that matches.
sourcefn expect_one_of_keywords(
&mut self,
keywords: &[Keyword],
) -> Result<Keyword, ParserError>
fn expect_one_of_keywords( &mut self, keywords: &[Keyword], ) -> Result<Keyword, ParserError>
Bail out if the current token is not one of the expected keywords, or consume it if it is
sourcefn expect_keyword(&mut self, expected: Keyword) -> Result<(), ParserError>
fn expect_keyword(&mut self, expected: Keyword) -> Result<(), ParserError>
Bail out if the current token is not an expected keyword, or consume it if it is
sourcefn expect_keywords(&mut self, expected: &[Keyword]) -> Result<(), ParserError>
fn expect_keywords(&mut self, expected: &[Keyword]) -> Result<(), ParserError>
Bail out if the following tokens are not the expected sequence of keywords, or consume them if they are.
sourcefn consume_token(&mut self, expected: &Token) -> bool
fn consume_token(&mut self, expected: &Token) -> bool
Consume the next token if it matches the expected token, otherwise return false
sourcefn expect_token(&mut self, expected: &Token) -> Result<(), ParserError>
fn expect_token(&mut self, expected: &Token) -> Result<(), ParserError>
Bail out if the current token is not an expected token, or consume it if it is
sourcefn expect_one_of_tokens(
&mut self,
tokens: &[Token],
) -> Result<Token, ParserError>
fn expect_one_of_tokens( &mut self, tokens: &[Token], ) -> Result<Token, ParserError>
Bail out if the current token is not one of the expected tokens, or consume it if it is
sourcefn expect_keyword_or_token(
&mut self,
expected_keyword: Keyword,
expected_token: &Token,
) -> Result<(), ParserError>
fn expect_keyword_or_token( &mut self, expected_keyword: Keyword, expected_token: &Token, ) -> Result<(), ParserError>
Bail out if the current token is not an expected keyword or token, or consume it if it is
sourcefn parse_comma_separated<T, F>(&mut self, f: F) -> Result<Vec<T>, ParserError>
fn parse_comma_separated<T, F>(&mut self, f: F) -> Result<Vec<T>, ParserError>
Parse a comma-separated list of 1+ items accepted by F
fn maybe_parse<T, F>(&mut self, f: F) -> Option<T>
sourcefn parse_create(&mut self) -> Result<Statement<Raw>, ParserStatementError>
fn parse_create(&mut self) -> Result<Statement<Raw>, ParserStatementError>
Parse a SQL CREATE statement
fn parse_create_database(&mut self) -> Result<Statement<Raw>, ParserError>
fn parse_create_schema(&mut self) -> Result<Statement<Raw>, ParserError>
fn parse_format(&mut self) -> Result<Format<Raw>, ParserError>
fn parse_avro_schema(&mut self) -> Result<AvroSchema<Raw>, ParserError>
fn parse_avro_schema_option( &mut self, ) -> Result<AvroSchemaOption<Raw>, ParserError>
fn parse_protobuf_schema(&mut self) -> Result<ProtobufSchema<Raw>, ParserError>
fn parse_csr_connection_reference( &mut self, ) -> Result<CsrConnection<Raw>, ParserError>
fn parse_csr_config_option( &mut self, ) -> Result<CsrConfigOption<Raw>, ParserError>
fn parse_avro_doc_on_option_name( &mut self, ) -> Result<DocOnIdentifier<Raw>, ParserError>
fn parse_csr_connection_avro( &mut self, ) -> Result<CsrConnectionAvro<Raw>, ParserError>
fn parse_csr_connection_proto( &mut self, ) -> Result<CsrConnectionProtobuf<Raw>, ParserError>
fn parse_source_error_policy_option( &mut self, ) -> Result<SourceErrorPolicy, ParserError>
fn parse_source_envelope(&mut self) -> Result<SourceEnvelope, ParserError>
fn parse_sink_envelope(&mut self) -> Result<SinkEnvelope, ParserError>
sourcefn parse_validate(&mut self) -> Result<Statement<Raw>, ParserError>
fn parse_validate(&mut self) -> Result<Statement<Raw>, ParserError>
Parse a VALIDATE
statement
fn parse_create_connection(&mut self) -> Result<Statement<Raw>, ParserError>
fn parse_create_connection_option_name( &mut self, ) -> Result<CreateConnectionOptionName, ParserError>
sourcefn parse_create_connection_option(
&mut self,
) -> Result<CreateConnectionOption<Raw>, ParserError>
fn parse_create_connection_option( &mut self, ) -> Result<CreateConnectionOption<Raw>, ParserError>
Parses a single valid option in the WITH block of a create source
fn parse_default_aws_privatelink( &mut self, ) -> Result<WithOptionValue<Raw>, ParserError>
fn parse_kafka_broker(&mut self) -> Result<WithOptionValue<Raw>, ParserError>
fn parse_kafka_broker_aws_privatelink_option( &mut self, ) -> Result<KafkaBrokerAwsPrivatelinkOption<Raw>, ParserError>
fn parse_kafka_source_config_option( &mut self, ) -> Result<KafkaSourceConfigOption<Raw>, ParserError>
fn parse_kafka_sink_config_option( &mut self, ) -> Result<KafkaSinkConfigOption<Raw>, ParserError>
fn parse_connection_option_name( &mut self, ) -> Result<ConnectionOptionName, ParserError>
fn parse_connection_option_unified( &mut self, ) -> Result<ConnectionOption<Raw>, ParserError>
fn parse_create_subsource(&mut self) -> Result<Statement<Raw>, ParserError>
fn parse_create_subsource_option( &mut self, ) -> Result<CreateSubsourceOption<Raw>, ParserError>
fn parse_create_source(&mut self) -> Result<Statement<Raw>, ParserError>
fn parse_subsource_references( &mut self, ) -> Result<ExternalReferenceExport, ParserError>
sourcefn parse_source_columns(
&mut self,
) -> Result<(Vec<Ident>, Option<KeyConstraint>), ParserError>
fn parse_source_columns( &mut self, ) -> Result<(Vec<Ident>, Option<KeyConstraint>), ParserError>
Parses the column section of a CREATE SOURCE statement which can be empty or a comma-separated list of column identifiers and a single key constraint, e.g.
(col_0, col_i, …, col_n, key_constraint)
sourcefn parse_key_constraint(&mut self) -> Result<Option<KeyConstraint>, ParserError>
fn parse_key_constraint(&mut self) -> Result<Option<KeyConstraint>, ParserError>
Parses a key constraint.
fn parse_source_option_name( &mut self, ) -> Result<CreateSourceOptionName, ParserError>
sourcefn parse_source_option(
&mut self,
) -> Result<CreateSourceOption<Raw>, ParserError>
fn parse_source_option( &mut self, ) -> Result<CreateSourceOption<Raw>, ParserError>
Parses a single valid option in the WITH block of a create source
fn parse_create_webhook_source( &mut self, name: UnresolvedItemName, if_not_exists: bool, in_cluster: Option<RawClusterName>, ) -> Result<Statement<Raw>, ParserError>
fn parse_create_webhook_check_options( &mut self, ) -> Result<CreateWebhookSourceCheckOptions<Raw>, ParserError>
fn parse_create_sink(&mut self) -> Result<Statement<Raw>, ParserError>
sourcefn parse_create_sink_option_name(
&mut self,
) -> Result<CreateSinkOptionName, ParserError>
fn parse_create_sink_option_name( &mut self, ) -> Result<CreateSinkOptionName, ParserError>
Parse the name of a CREATE SINK optional parameter
sourcefn parse_create_sink_option(
&mut self,
) -> Result<CreateSinkOption<Raw>, ParserError>
fn parse_create_sink_option( &mut self, ) -> Result<CreateSinkOption<Raw>, ParserError>
Parse a NAME = VALUE parameter for CREATE SINK
fn parse_create_source_connection( &mut self, ) -> Result<CreateSourceConnection<Raw>, ParserError>
fn parse_pg_connection_option( &mut self, ) -> Result<PgConfigOption<Raw>, ParserError>
fn parse_mysql_connection_option( &mut self, ) -> Result<MySqlConfigOption<Raw>, ParserError>
fn parse_load_generator_option( &mut self, ) -> Result<LoadGeneratorOption<Raw>, ParserError>
fn parse_create_sink_connection( &mut self, ) -> Result<CreateSinkConnection<Raw>, ParserError>
fn parse_create_view(&mut self) -> Result<Statement<Raw>, ParserError>
fn parse_view_definition(&mut self) -> Result<ViewDefinition<Raw>, ParserError>
fn parse_create_materialized_view( &mut self, ) -> Result<Statement<Raw>, ParserError>
fn parse_create_continual_task(&mut self) -> Result<Statement<Raw>, ParserError>
fn parse_create_continual_task_from_transform( &mut self, ) -> Result<Statement<Raw>, ParserError>
fn parse_create_continual_task_from_retain( &mut self, ) -> Result<Statement<Raw>, ParserError>
fn parse_materialized_view_option_name( &mut self, ) -> Result<MaterializedViewOptionName, ParserError>
fn parse_materialized_view_option( &mut self, ) -> Result<MaterializedViewOption<Raw>, ParserError>
fn parse_option_retain_history( &mut self, ) -> Result<Option<WithOptionValue<Raw>>, ParserError>
fn parse_retain_history(&mut self) -> Result<WithOptionValue<Raw>, ParserError>
fn parse_materialized_view_refresh_option_value( &mut self, ) -> Result<WithOptionValue<Raw>, ParserError>
fn parse_create_continual_task_with_options( &mut self, ) -> Result<Vec<ContinualTaskOption<Raw>>, ParserError>
fn parse_continual_task_option_name( &mut self, ) -> Result<ContinualTaskOptionName, ParserError>
fn parse_continual_task_option( &mut self, ) -> Result<ContinualTaskOption<Raw>, ParserError>
fn parse_create_index(&mut self) -> Result<Statement<Raw>, ParserError>
fn parse_table_option_name(&mut self) -> Result<TableOptionName, ParserError>
fn parse_table_option(&mut self) -> Result<TableOption<Raw>, ParserError>
fn parse_index_option_name(&mut self) -> Result<IndexOptionName, ParserError>
fn parse_index_option(&mut self) -> Result<IndexOption<Raw>, ParserError>
fn parse_raw_ident(&mut self) -> Result<RawClusterName, ParserError>
fn parse_raw_network_policy_name( &mut self, ) -> Result<RawNetworkPolicyName, ParserError>
fn parse_raw_ident_str(&mut self) -> Result<String, ParserError>
fn parse_optional_in_cluster( &mut self, ) -> Result<Option<RawClusterName>, ParserError>
fn parse_create_role(&mut self) -> Result<Statement<Raw>, ParserError>
fn parse_role_attributes(&mut self) -> Vec<RoleAttribute>
fn parse_create_secret(&mut self) -> Result<Statement<Raw>, ParserError>
fn parse_create_type(&mut self) -> Result<Statement<Raw>, ParserError>
fn parse_create_type_list_option( &mut self, ) -> Result<CreateTypeListOption<Raw>, ParserError>
fn parse_create_type_map_option( &mut self, ) -> Result<CreateTypeMapOption<Raw>, ParserError>
fn parse_create_cluster(&mut self) -> Result<Statement<Raw>, ParserError>
fn parse_cluster_option_name( &mut self, ) -> Result<ClusterOptionName, ParserError>
fn parse_cluster_option(&mut self) -> Result<ClusterOption<Raw>, ParserError>
fn parse_alter_cluster_option( &mut self, ) -> Result<ClusterAlterOption<Raw>, ParserError>
fn parse_cluster_alter_until_ready_option( &mut self, ) -> Result<ClusterAlterUntilReadyOption<Raw>, ParserError>
fn parse_cluster_option_replicas( &mut self, ) -> Result<ClusterOption<Raw>, ParserError>
fn parse_cluster_option_schedule( &mut self, ) -> Result<ClusterOption<Raw>, ParserError>
fn parse_replica_option(&mut self) -> Result<ReplicaOption<Raw>, ParserError>
fn parse_cluster_feature(&mut self) -> Result<ClusterFeature<Raw>, ParserError>
fn parse_create_cluster_replica( &mut self, ) -> Result<Statement<Raw>, ParserError>
fn parse_if_exists(&mut self) -> Result<bool, ParserError>
fn parse_if_not_exists(&mut self) -> Result<bool, ParserError>
fn parse_alias(&mut self) -> Result<Option<Ident>, ParserError>
fn parse_source_include_metadata( &mut self, ) -> Result<Vec<SourceIncludeMetadata>, ParserError>
fn parse_discard(&mut self) -> Result<Statement<Raw>, ParserError>
fn parse_drop(&mut self) -> Result<Statement<Raw>, ParserStatementError>
fn parse_drop_objects(&mut self) -> Result<Statement<Raw>, ParserError>
fn parse_drop_clusters( &mut self, if_exists: bool, ) -> Result<Statement<Raw>, ParserError>
fn parse_drop_cluster_replicas( &mut self, if_exists: bool, ) -> Result<Statement<Raw>, ParserError>
fn parse_drop_owned(&mut self) -> Result<Statement<Raw>, ParserError>
fn parse_cluster_replica_name( &mut self, ) -> Result<QualifiedReplica, ParserError>
fn parse_alter_network_policy(&mut self) -> Result<Statement<Raw>, ParserError>
fn parse_create_network_policy(&mut self) -> Result<Statement<Raw>, ParserError>
fn parse_network_policy_option( &mut self, ) -> Result<NetworkPolicyOption<Raw>, ParserError>
fn parse_network_policy_option_rules( &mut self, ) -> Result<NetworkPolicyOption<Raw>, ParserError>
fn parse_network_policy_rule_option( &mut self, ) -> Result<NetworkPolicyRuleOption<Raw>, ParserError>
fn parse_create_table(&mut self) -> Result<Statement<Raw>, ParserError>
fn parse_create_table_from_source( &mut self, ) -> Result<Statement<Raw>, ParserError>
fn parse_table_from_source_option( &mut self, ) -> Result<TableFromSourceOption<Raw>, ParserError>
fn parse_table_from_source_columns( &mut self, ) -> Result<(TableFromSourceColumns<Raw>, Vec<TableConstraint<Raw>>), ParserError>
fn parse_columns( &mut self, optional: IsOptional, ) -> Result<(Vec<ColumnDef<Raw>>, Vec<TableConstraint<Raw>>), ParserError>
fn parse_column_option_def( &mut self, ) -> Result<ColumnOptionDef<Raw>, ParserError>
fn parse_optional_table_constraint( &mut self, ) -> Result<Option<TableConstraint<Raw>>, ParserError>
fn parse_object_option_value( &mut self, ) -> Result<WithOptionValue<Raw>, ParserError>
fn parse_optional_option_value( &mut self, ) -> Result<Option<WithOptionValue<Raw>>, ParserError>
fn parse_option_sequence<T, F>( &mut self, f: F, ) -> Result<Option<Vec<T>>, ParserError>
fn parse_option_map( &mut self, ) -> Result<Option<BTreeMap<String, WithOptionValue<Raw>>>, ParserError>
fn parse_option_value(&mut self) -> Result<WithOptionValue<Raw>, ParserError>
fn parse_data_type_option_value( &mut self, ) -> Result<WithOptionValue<Raw>, ParserError>
fn parse_alter(&mut self) -> Result<Statement<Raw>, ParserStatementError>
fn parse_alter_object(&mut self) -> Result<Statement<Raw>, ParserStatementError>
fn parse_alter_cluster( &mut self, object_type: ObjectType, ) -> Result<Statement<Raw>, ParserStatementError>
fn parse_alter_source(&mut self) -> Result<Statement<Raw>, ParserStatementError>
fn parse_alter_source_add_subsource_option( &mut self, ) -> Result<AlterSourceAddSubsourceOption<Raw>, ParserError>
fn parse_alter_index(&mut self) -> Result<Statement<Raw>, ParserStatementError>
fn parse_alter_secret(&mut self) -> Result<Statement<Raw>, ParserStatementError>
sourcefn parse_alter_sink(&mut self) -> Result<Statement<Raw>, ParserStatementError>
fn parse_alter_sink(&mut self) -> Result<Statement<Raw>, ParserStatementError>
Parse an ALTER SINK statement.
sourcefn parse_alter_system(&mut self) -> Result<Statement<Raw>, ParserStatementError>
fn parse_alter_system(&mut self) -> Result<Statement<Raw>, ParserStatementError>
Parse an ALTER SYSTEM statement.
fn parse_alter_connection( &mut self, ) -> Result<Statement<Raw>, ParserStatementError>
fn parse_alter_connection_action( &mut self, ) -> Result<AlterConnectionAction<Raw>, ParserError>
sourcefn parse_alter_connection_option(
&mut self,
) -> Result<AlterConnectionOption<Raw>, ParserError>
fn parse_alter_connection_option( &mut self, ) -> Result<AlterConnectionOption<Raw>, ParserError>
Parses a single valid option in the WITH block of a create source
fn parse_alter_role(&mut self) -> Result<Statement<Raw>, ParserError>
fn parse_alter_default_privileges( &mut self, ) -> Result<Statement<Raw>, ParserError>
fn parse_alter_views( &mut self, object_type: ObjectType, ) -> Result<Statement<Raw>, ParserStatementError>
fn parse_alter_schema( &mut self, object_type: ObjectType, ) -> Result<Statement<Raw>, ParserStatementError>
sourcefn maybe_parse_alter_set_cluster(
&mut self,
if_exists: bool,
name: &UnresolvedItemName,
object_type: ObjectType,
) -> Option<Result<Statement<Raw>, ParserStatementError>>
fn maybe_parse_alter_set_cluster( &mut self, if_exists: bool, name: &UnresolvedItemName, object_type: ObjectType, ) -> Option<Result<Statement<Raw>, ParserStatementError>>
Parses CLUSTER name
fragments into a AlterSetClusterStatement
if CLUSTER
is found.
sourcefn parse_alter_set_cluster(
&mut self,
if_exists: bool,
name: UnresolvedItemName,
object_type: ObjectType,
) -> Result<Statement<Raw>, ParserStatementError>
fn parse_alter_set_cluster( &mut self, if_exists: bool, name: UnresolvedItemName, object_type: ObjectType, ) -> Result<Statement<Raw>, ParserStatementError>
Parses IN CLUSTER name
fragments into a AlterSetClusterStatement
.
sourcefn parse_copy(&mut self) -> Result<Statement<Raw>, ParserStatementError>
fn parse_copy(&mut self) -> Result<Statement<Raw>, ParserStatementError>
Parse a copy statement
fn parse_copy_option(&mut self) -> Result<CopyOption<Raw>, ParserError>
sourcefn parse_value(&mut self) -> Result<Value, ParserError>
fn parse_value(&mut self) -> Result<Value, ParserError>
Parse a literal value (numbers, strings, date/time, booleans)
fn parse_array(&mut self) -> Result<Expr<Raw>, ParserError>
fn parse_list(&mut self) -> Result<Expr<Raw>, ParserError>
fn parse_map(&mut self) -> Result<Expr<Raw>, ParserError>
fn parse_sequence<F>(&mut self, f: F) -> Result<Vec<Expr<Raw>>, ParserError>
fn parse_number_value(&mut self) -> Result<Value, ParserError>
fn parse_version(&mut self) -> Result<Version, ParserError>
sourcefn parse_literal_int(&mut self) -> Result<i64, ParserError>
fn parse_literal_int(&mut self) -> Result<i64, ParserError>
Parse a signed literal integer.
sourcefn parse_literal_uint(&mut self) -> Result<u64, ParserError>
fn parse_literal_uint(&mut self) -> Result<u64, ParserError>
Parse an unsigned literal integer.
sourcefn parse_literal_string(&mut self) -> Result<String, ParserError>
fn parse_literal_string(&mut self) -> Result<String, ParserError>
Parse a literal string
sourcefn parse_data_type(&mut self) -> Result<RawDataType, ParserError>
fn parse_data_type(&mut self) -> Result<RawDataType, ParserError>
Parse a SQL datatype (in the context of a CREATE TABLE statement for example)
fn parse_typ_mod(&mut self) -> Result<Vec<i64>, ParserError>
fn parse_timestamp_precision(&mut self) -> Result<Vec<i64>, ParserError>
sourcefn parse_optional_alias<F>(
&mut self,
is_reserved: F,
) -> Result<Option<Ident>, ParserError>
fn parse_optional_alias<F>( &mut self, is_reserved: F, ) -> Result<Option<Ident>, ParserError>
Parse AS identifier
(or simply identifier
if it’s not a reserved keyword)
Some examples with aliases: SELECT 1 foo
, SELECT COUNT(*) AS cnt
,
SELECT ... FROM t1 foo, t2 bar
, SELECT ... FROM (...) AS bar
sourcefn parse_optional_table_alias(
&mut self,
) -> Result<Option<TableAlias>, ParserError>
fn parse_optional_table_alias( &mut self, ) -> Result<Option<TableAlias>, ParserError>
Parse AS identifier
when the AS is describing a table-valued object,
like in ... FROM generate_series(1, 10) AS t (col)
. In this case
the alias is allowed to optionally name the columns in the table, in
addition to the table itself.
fn parse_deferred_item_name( &mut self, ) -> Result<DeferredItemName<Raw>, ParserError>
fn parse_raw_name(&mut self) -> Result<RawItemName, ParserError>
fn parse_column_name(&mut self) -> Result<ColumnName<Raw>, ParserError>
sourcefn parse_database_name(&mut self) -> Result<UnresolvedDatabaseName, ParserError>
fn parse_database_name(&mut self) -> Result<UnresolvedDatabaseName, ParserError>
Parse a possibly quoted database identifier, e.g.
foo
or "mydatabase"
sourcefn parse_schema_name(&mut self) -> Result<UnresolvedSchemaName, ParserError>
fn parse_schema_name(&mut self) -> Result<UnresolvedSchemaName, ParserError>
Parse a possibly qualified, possibly quoted schema identifier, e.g.
foo
or mydatabase."schema"
sourcefn parse_item_name(&mut self) -> Result<UnresolvedItemName, ParserError>
fn parse_item_name(&mut self) -> Result<UnresolvedItemName, ParserError>
Parse a possibly qualified, possibly quoted object identifier, e.g.
foo
or myschema."table"
sourcefn parse_object_name(
&mut self,
object_type: ObjectType,
) -> Result<UnresolvedObjectName, ParserError>
fn parse_object_name( &mut self, object_type: ObjectType, ) -> Result<UnresolvedObjectName, ParserError>
Parse an object name.
sourcefn parse_identifiers(&mut self) -> Result<Vec<Ident>, ParserError>
fn parse_identifiers(&mut self) -> Result<Vec<Ident>, ParserError>
Parse one or more simple one-word identifiers separated by a ‘.’
sourcefn parse_identifier(&mut self) -> Result<Ident, ParserError>
fn parse_identifier(&mut self) -> Result<Ident, ParserError>
Parse a simple one-word identifier (possibly quoted, possibly a keyword)
fn consume_identifier(&mut self) -> Result<Option<Ident>, ParserError>
fn parse_qualified_identifier( &mut self, id: Ident, ) -> Result<Expr<Raw>, ParserError>
sourcefn parse_parenthesized_column_list(
&mut self,
optional: IsOptional,
) -> Result<Vec<Ident>, ParserError>
fn parse_parenthesized_column_list( &mut self, optional: IsOptional, ) -> Result<Vec<Ident>, ParserError>
Parse a parenthesized comma-separated list of unqualified, possibly quoted identifiers
fn parse_optional_precision(&mut self) -> Result<Option<u64>, ParserError>
fn parse_map_type(&mut self) -> Result<RawDataType, ParserError>
fn parse_delete(&mut self) -> Result<Statement<Raw>, ParserError>
sourcefn parse_select_statement(
&mut self,
) -> Result<SelectStatement<Raw>, ParserError>
fn parse_select_statement( &mut self, ) -> Result<SelectStatement<Raw>, ParserError>
Parses a SELECT (or WITH, VALUES, TABLE) statement with optional AS OF.
sourcefn parse_query(&mut self) -> Result<Query<Raw>, ParserError>
fn parse_query(&mut self) -> Result<Query<Raw>, ParserError>
Parse a query expression, i.e. a SELECT
statement optionally
preceded with some WITH
CTE declarations and optionally followed
by ORDER BY
. Unlike some other parse_… methods, this one doesn’t
expect the initial keyword to be already consumed
fn parse_mut_rec_block_option( &mut self, ) -> Result<MutRecBlockOption<Raw>, ParserError>
fn parse_query_tail( &mut self, ctes: CteBlock<Raw>, body: SetExpr<Raw>, ) -> Result<Query<Raw>, ParserError>
sourcefn parse_cte(&mut self) -> Result<Cte<Raw>, ParserError>
fn parse_cte(&mut self) -> Result<Cte<Raw>, ParserError>
Parse a CTE (alias [( col1, col2, ... )] AS (subquery)
)
sourcefn parse_cte_mut_rec(&mut self) -> Result<CteMutRec<Raw>, ParserError>
fn parse_cte_mut_rec(&mut self) -> Result<CteMutRec<Raw>, ParserError>
Parse a mutually recursive CTE (alias ( col1: typ1, col2: typ2, ... ) AS (subquery)
).
The main distinction from parse_cte
is that the column names and types are mandatory.
This is not how SQL works for WITH RECURSIVE
, but we are doing it for now to make the
query interpretation that much easier.
sourcefn parse_query_body(
&mut self,
precedence: SetPrecedence,
) -> Result<SetExpr<Raw>, ParserError>
fn parse_query_body( &mut self, precedence: SetPrecedence, ) -> Result<SetExpr<Raw>, ParserError>
Parse a “query body”, which is an expression with roughly the following grammar:
query_body ::= restricted_select | '(' subquery ')' | set_operation
restricted_select ::= 'SELECT' [expr_list] [ from ] [ where ] [ groupby_having ]
subquery ::= query_body [ order_by_limit ]
set_operation ::= query_body { 'UNION' | 'EXCEPT' | 'INTERSECT' } [ 'ALL' ] query_body
fn parse_query_body_seeded( &mut self, precedence: SetPrecedence, expr: SetExpr<Raw>, ) -> Result<SetExpr<Raw>, ParserError>
fn parse_set_operator(&self, token: &Option<Token>) -> Option<SetOperator>
sourcefn parse_select(&mut self) -> Result<Select<Raw>, ParserError>
fn parse_select(&mut self) -> Result<Select<Raw>, ParserError>
Parse a restricted SELECT
statement (no CTEs / UNION
/ ORDER BY
),
assuming the initial SELECT
was already consumed
fn parse_select_option(&mut self) -> Result<SelectOption<Raw>, ParserError>
fn parse_set(&mut self) -> Result<Statement<Raw>, ParserStatementError>
fn parse_set_schema_to(&mut self) -> Result<SetVariableTo, ParserError>
fn parse_set_variable_to(&mut self) -> Result<SetVariableTo, ParserError>
fn parse_set_variable_value(&mut self) -> Result<SetVariableValue, ParserError>
fn parse_reset(&mut self) -> Result<Statement<Raw>, ParserError>
fn parse_show(&mut self) -> Result<ShowStatement<Raw>, ParserError>
fn parse_show_columns(&mut self) -> Result<ShowStatement<Raw>, ParserError>
fn parse_show_statement_filter( &mut self, ) -> Result<Option<ShowStatementFilter<Raw>>, ParserError>
fn parse_show_privileges(&mut self) -> Result<ShowStatement<Raw>, ParserError>
fn parse_show_default_privileges( &mut self, ) -> Result<ShowStatement<Raw>, ParserError>
fn parse_inspect(&mut self) -> Result<ShowStatement<Raw>, ParserError>
fn parse_table_and_joins(&mut self) -> Result<TableWithJoins<Raw>, ParserError>
sourcefn parse_table_factor(&mut self) -> Result<TableFactor<Raw>, ParserError>
fn parse_table_factor(&mut self) -> Result<TableFactor<Raw>, ParserError>
A table name or a parenthesized subquery, followed by optional [AS] alias
fn parse_rows_from(&mut self) -> Result<TableFactor<Raw>, ParserError>
fn parse_named_function(&mut self) -> Result<Function<Raw>, ParserError>
fn parse_derived_table_factor( &mut self, lateral: IsLateral, ) -> Result<TableFactor<Raw>, ParserError>
fn parse_join_constraint( &mut self, natural: bool, ) -> Result<JoinConstraint<Raw>, ParserError>
sourcefn parse_insert(&mut self) -> Result<Statement<Raw>, ParserError>
fn parse_insert(&mut self) -> Result<Statement<Raw>, ParserError>
Parse an INSERT statement
fn parse_returning(&mut self) -> Result<Vec<SelectItem<Raw>>, ParserError>
fn parse_update(&mut self) -> Result<Statement<Raw>, ParserError>
sourcefn parse_assignment(&mut self) -> Result<Assignment<Raw>, ParserError>
fn parse_assignment(&mut self) -> Result<Assignment<Raw>, ParserError>
Parse a var = expr
assignment, used in an UPDATE statement
fn parse_optional_args( &mut self, allow_order_by: bool, ) -> Result<FunctionArgs<Raw>, ParserError>
sourcefn parse_optional_as_of(&mut self) -> Result<Option<AsOf<Raw>>, ParserError>
fn parse_optional_as_of(&mut self) -> Result<Option<AsOf<Raw>>, ParserError>
Parse AS OF
, if present.
sourcefn parse_optional_up_to(&mut self) -> Result<Option<Expr<Raw>>, ParserError>
fn parse_optional_up_to(&mut self) -> Result<Option<Expr<Raw>>, ParserError>
Parse UP TO
, if present
sourcefn parse_optional_internal_as_of(&mut self) -> Result<Option<u64>, ParserError>
fn parse_optional_internal_as_of(&mut self) -> Result<Option<u64>, ParserError>
Parse AS OF
, if present.
In contrast to parse_optional_as_of
, this parser only supports AS OF <time>
syntax and
directly returns an u64
. It is only meant to be used for internal SQL syntax.
sourcefn parse_select_item(&mut self) -> Result<SelectItem<Raw>, ParserError>
fn parse_select_item(&mut self) -> Result<SelectItem<Raw>, ParserError>
Parse a comma-delimited list of projections after SELECT
sourcefn parse_order_by_expr(&mut self) -> Result<OrderByExpr<Raw>, ParserError>
fn parse_order_by_expr(&mut self) -> Result<OrderByExpr<Raw>, ParserError>
Parse an expression, optionally followed by ASC or DESC,
and then [NULLS { FIRST | LAST }]
(used in ORDER BY)
fn parse_values(&mut self) -> Result<Values<Raw>, ParserError>
fn parse_start_transaction(&mut self) -> Result<Statement<Raw>, ParserError>
fn parse_begin(&mut self) -> Result<Statement<Raw>, ParserError>
fn parse_transaction_modes( &mut self, required: bool, ) -> Result<Vec<TransactionMode>, ParserError>
fn parse_commit(&mut self) -> Result<Statement<Raw>, ParserError>
fn parse_rollback(&mut self) -> Result<Statement<Raw>, ParserError>
fn parse_commit_rollback_chain(&mut self) -> Result<bool, ParserError>
fn parse_tail(&self) -> Result<Statement<Raw>, ParserError>
fn parse_subscribe(&mut self) -> Result<Statement<Raw>, ParserError>
fn parse_subscribe_option( &mut self, ) -> Result<SubscribeOption<Raw>, ParserError>
fn parse_subscribe_output( &mut self, ) -> Result<SubscribeOutput<Raw>, ParserError>
sourcefn parse_explain(&mut self) -> Result<Statement<Raw>, ParserStatementError>
fn parse_explain(&mut self) -> Result<Statement<Raw>, ParserStatementError>
Parse an EXPLAIN
statement, assuming that the EXPLAIN
token
has already been consumed.
fn parse_explainee(&mut self) -> Result<Explainee<Raw>, ParserError>
sourcefn parse_explain_plan(&mut self) -> Result<Statement<Raw>, ParserError>
fn parse_explain_plan(&mut self) -> Result<Statement<Raw>, ParserError>
Parse an EXPLAIN ... PLAN
statement, assuming that the EXPLAIN
token
has already been consumed.
fn parse_explain_plan_option( &mut self, ) -> Result<ExplainPlanOption<Raw>, ParserError>
sourcefn parse_explain_pushdown(&mut self) -> Result<Statement<Raw>, ParserError>
fn parse_explain_pushdown(&mut self) -> Result<Statement<Raw>, ParserError>
Parse an EXPLAIN FILTER PUSHDOWN
statement, assuming that the EXPLAIN PUSHDOWN
tokens have already been consumed.
sourcefn parse_explain_timestamp(&mut self) -> Result<Statement<Raw>, ParserError>
fn parse_explain_timestamp(&mut self) -> Result<Statement<Raw>, ParserError>
Parse an EXPLAIN TIMESTAMP
statement, assuming that the EXPLAIN TIMESTAMP
tokens have already been consumed.
sourcefn parse_explain_schema(&mut self) -> Result<Statement<Raw>, ParserError>
fn parse_explain_schema(&mut self) -> Result<Statement<Raw>, ParserError>
Parse an EXPLAIN [KEY|VALUE] SCHEMA
statement assuming that the EXPLAIN
token
have already been consumed
sourcefn parse_declare(&mut self) -> Result<Statement<Raw>, ParserStatementError>
fn parse_declare(&mut self) -> Result<Statement<Raw>, ParserStatementError>
Parse a DECLARE
statement, assuming that the DECLARE
token
has already been consumed.
sourcefn parse_close(&mut self) -> Result<Statement<Raw>, ParserError>
fn parse_close(&mut self) -> Result<Statement<Raw>, ParserError>
Parse a CLOSE
statement, assuming that the CLOSE
token
has already been consumed.
sourcefn parse_prepare(&mut self) -> Result<Statement<Raw>, ParserStatementError>
fn parse_prepare(&mut self) -> Result<Statement<Raw>, ParserStatementError>
Parse a PREPARE
statement, assuming that the PREPARE
token
has already been consumed.
sourcefn parse_execute(&mut self) -> Result<Statement<Raw>, ParserError>
fn parse_execute(&mut self) -> Result<Statement<Raw>, ParserError>
Parse a EXECUTE
statement, assuming that the EXECUTE
token
has already been consumed.
sourcefn parse_deallocate(&mut self) -> Result<Statement<Raw>, ParserError>
fn parse_deallocate(&mut self) -> Result<Statement<Raw>, ParserError>
Parse a DEALLOCATE
statement, assuming that the DEALLOCATE
token
has already been consumed.
sourcefn parse_fetch(&mut self) -> Result<Statement<Raw>, ParserError>
fn parse_fetch(&mut self) -> Result<Statement<Raw>, ParserError>
Parse a FETCH
statement, assuming that the FETCH
token
has already been consumed.
fn parse_fetch_option(&mut self) -> Result<FetchOption<Raw>, ParserError>
sourcefn parse_raise(&mut self) -> Result<Statement<Raw>, ParserError>
fn parse_raise(&mut self) -> Result<Statement<Raw>, ParserError>
Parse a RAISE
statement, assuming that the RAISE
token
has already been consumed.
sourcefn parse_grant(&mut self) -> Result<Statement<Raw>, ParserStatementError>
fn parse_grant(&mut self) -> Result<Statement<Raw>, ParserStatementError>
Parse a GRANT
statement, assuming that the GRANT
token
has already been consumed.
sourcefn parse_grant_privilege(
&mut self,
privileges: PrivilegeSpecification,
) -> Result<Statement<Raw>, ParserError>
fn parse_grant_privilege( &mut self, privileges: PrivilegeSpecification, ) -> Result<Statement<Raw>, ParserError>
Parse a GRANT PRIVILEGE
statement, assuming that the GRANT
token
and all privileges have already been consumed.
sourcefn parse_grant_role(&mut self) -> Result<Statement<Raw>, ParserError>
fn parse_grant_role(&mut self) -> Result<Statement<Raw>, ParserError>
Parse a GRANT ROLE
statement, assuming that the GRANT
token
has already been consumed.
sourcefn parse_revoke(&mut self) -> Result<Statement<Raw>, ParserStatementError>
fn parse_revoke(&mut self) -> Result<Statement<Raw>, ParserStatementError>
Parse a REVOKE
statement, assuming that the REVOKE
token
has already been consumed.
sourcefn parse_revoke_privilege(
&mut self,
privileges: PrivilegeSpecification,
) -> Result<Statement<Raw>, ParserError>
fn parse_revoke_privilege( &mut self, privileges: PrivilegeSpecification, ) -> Result<Statement<Raw>, ParserError>
Parse a REVOKE PRIVILEGE
statement, assuming that the REVOKE
token
and all privileges have already been consumed.
sourcefn parse_revoke_role(&mut self) -> Result<Statement<Raw>, ParserError>
fn parse_revoke_role(&mut self) -> Result<Statement<Raw>, ParserError>
Parse a REVOKE ROLE
statement, assuming that the REVOKE
token
has already been consumed.
fn expect_grant_target_specification( &mut self, statement_type: &str, ) -> Result<GrantTargetSpecification<Raw>, ParserError>
sourcefn expect_grant_revoke_object_type(
&mut self,
statement_type: &str,
) -> Result<ObjectType, ParserError>
fn expect_grant_revoke_object_type( &mut self, statement_type: &str, ) -> Result<ObjectType, ParserError>
Bail out if the current token is not an object type suitable for a GRANT/REVOKE, or consume and return it if it is.
sourcefn expect_grant_revoke_plural_object_type(
&mut self,
statement_type: &str,
) -> Result<ObjectType, ParserError>
fn expect_grant_revoke_plural_object_type( &mut self, statement_type: &str, ) -> Result<ObjectType, ParserError>
Bail out if the current token is not a plural object type suitable for a GRANT/REVOKE, or consume and return it if it is.
fn expect_grant_revoke_object_type_inner( &self, statement_type: &str, object_type: ObjectType, ) -> Result<ObjectType, ParserError>
sourcefn expect_object_type(&mut self) -> Result<ObjectType, ParserError>
fn expect_object_type(&mut self) -> Result<ObjectType, ParserError>
Bail out if the current token is not an object type, or consume and return it if it is.
sourcefn parse_object_type(&mut self) -> Option<ObjectType>
fn parse_object_type(&mut self) -> Option<ObjectType>
Look for an object type and return it if it matches.
sourcefn expect_plural_object_type(&mut self) -> Result<ObjectType, ParserError>
fn expect_plural_object_type(&mut self) -> Result<ObjectType, ParserError>
Bail out if the current token is not an object type in the plural form, or consume and return it if it is.
sourcefn parse_plural_object_type(&mut self) -> Option<ObjectType>
fn parse_plural_object_type(&mut self) -> Option<ObjectType>
Look for an object type in the plural form and return it if it matches.
sourcefn expect_plural_object_type_for_privileges(
&mut self,
) -> Result<ObjectType, ParserError>
fn expect_plural_object_type_for_privileges( &mut self, ) -> Result<ObjectType, ParserError>
Bail out if the current token is not a privilege object type, or consume and return it if it is.
sourcefn expect_plural_system_object_type_for_privileges(
&mut self,
) -> Result<SystemObjectType, ParserError>
fn expect_plural_system_object_type_for_privileges( &mut self, ) -> Result<SystemObjectType, ParserError>
Bail out if the current token is not a privilege object type in the plural form, or consume and return it if it is.
sourcefn parse_privilege(&mut self) -> Option<Privilege>
fn parse_privilege(&mut self) -> Option<Privilege>
Look for a privilege and return it if it matches.
sourcefn parse_privilege_specification(&mut self) -> Option<PrivilegeSpecification>
fn parse_privilege_specification(&mut self) -> Option<PrivilegeSpecification>
Parse one or more privileges separated by a ‘,’.
sourcefn expect_role_specification(&mut self) -> Result<Ident, ParserError>
fn expect_role_specification(&mut self) -> Result<Ident, ParserError>
Bail out if the current token is not a role specification, or consume and return it if it is.
sourcefn parse_reassign_owned(&mut self) -> Result<Statement<Raw>, ParserError>
fn parse_reassign_owned(&mut self) -> Result<Statement<Raw>, ParserError>
Parse a REASSIGN OWNED
statement, assuming that the REASSIGN
token
has already been consumed.
fn parse_comment(&mut self) -> Result<Statement<Raw>, ParserError>
pub fn new_identifier<S>(&self, s: S) -> Result<Ident, ParserError>
§impl<'a> Parser<'a>
impl<'a> Parser<'a>
fn parse_explain_plan_option_name( &mut self, ) -> Result<ExplainPlanOptionName, ParserError>
fn parse_cluster_feature_name( &mut self, ) -> Result<ClusterFeatureName, ParserError>
Trait Implementations§
source§impl CheckedRecursion for Parser<'_>
impl CheckedRecursion for Parser<'_>
source§fn recursion_guard(&self) -> &RecursionGuard
fn recursion_guard(&self) -> &RecursionGuard
source§fn checked_recur<F, T, E>(&self, f: F) -> Result<T, E>
fn checked_recur<F, T, E>(&self, f: F) -> Result<T, E>
f
if so. Read moresource§fn checked_recur_mut<F, T, E>(&mut self, f: F) -> Result<T, E>
fn checked_recur_mut<F, T, E>(&mut self, f: F) -> Result<T, E>
CheckedRecursion::checked_recur
, but operates on a mutable
reference to Self
.Auto Trait Implementations§
impl<'a> !Freeze for Parser<'a>
impl<'a> !RefUnwindSafe for Parser<'a>
impl<'a> Send for Parser<'a>
impl<'a> !Sync for Parser<'a>
impl<'a> Unpin for Parser<'a>
impl<'a> UnwindSafe for Parser<'a>
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
source§impl<T> FutureExt for T
impl<T> FutureExt for T
source§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
source§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T
in a tonic::Request