Skip to content

Conversation

yoavcloud
Copy link
Contributor

This PR adds support for static method invocations of data type-specific methods. For example:
SELECT geography::STGeomFromText('LINESTRING(-122.360 47.656, -122.343 47.656 )', 4326)

See more here: https://learn.microsoft.com/en-us/sql/t-sql/spatial-geography/spatial-types-geography?view=sql-server-ver16

Comment on lines +1228 to +1236
let namespace = w.value;
self.expect_token(&Token::DoubleColon)?;
let name_with_namespace = match self.next_token().token {
Token::Word(func_name) => {
ObjectName(vec![Ident::new(format!("{}::{}", namespace, func_name.value))])
},
_ => return self.expected("identifier", self.peek_token())
};
Ok(self.parse_function(name_with_namespace)?)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we move the body to a self.parse_namespaced_method(w)? or similar function? Also if we can add an example syntax to the function doc with the link to clarify the syntax

_ => unreachable!(),
}

dialects.verified_stmt(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we add a scenario in the style of a::b::c().d()?

@github-actions
Copy link

Thank you for your contribution. Unfortunately, this pull request is stale because it has been open 60 days with no activity. Please remove the stale label or comment or this will be closed in 7 days.

@github-actions github-actions bot added the Stale label Jan 23, 2025
@github-actions github-actions bot closed this Jan 31, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants