MCPcopy Create free account
hub / github.com/MaterializeInc/materialize / needs_explicit_to

Method needs_explicit_to

src/sql-parser/src/ast/defs/statement.rs:3961–3966  ·  view source on GitHub ↗

Reports whether printing this relation after `SUBSCRIBE` requires the optional `TO` keyword to avoid reparsing the first name component as that keyword instead of as part of the relation name.

(&self, bare_identifiers: bool)

Source from the content-addressed store, hash-verified

3959 /// optional `TO` keyword to avoid reparsing the first name component as that
3960 /// keyword instead of as part of the relation name.
3961 pub fn needs_explicit_to(&self, bare_identifiers: bool) -> bool {
3962 let SubscribeRelation::Name(name) = self else {
3963 return false;
3964 };
3965 bare_identifiers && name_starts_with_bare_to(&name.to_ast_string_simple())
3966 }
3967}
3968
3969fn name_starts_with_bare_to(name: &str) -> bool {

Callers 2

doc_subscribeMethod · 0.80
fmtMethod · 0.80

Calls 2

name_starts_with_bare_toFunction · 0.85
to_ast_string_simpleMethod · 0.80

Tested by

no test coverage detected