We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
$$
CREATE FUNCTION
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
At the moment generic dialect does not support $$ in CREATE FUNCTION .. AS, would it make sense supporting it?
CREATE FUNCTION .. AS
It should be straight forward adding support for it
diff --git a/src/parser/mod.rs b/src/parser/mod.rs index a719056..5bdaf5c 100644 --- a/src/parser/mod.rs +++ b/src/parser/mod.rs @@ -5954,7 +5954,7 @@ impl<'a> Parser<'a> { pub fn parse_function_definition(&mut self) -> Result<FunctionDefinition, ParserError> { let peek_token = self.peek_token(); match peek_token.token { - Token::DollarQuotedString(value) if dialect_of!(self is PostgreSqlDialect) => { + Token::DollarQuotedString(value) if dialect_of!(self is PostgreSqlDialect | GenericDialect) => { self.next_token(); Ok(FunctionDefinition::DoubleDollarDef(value.value)) } diff --git a/tests/sqlparser_postgres.rs b/tests/sqlparser_postgres.rs index 9de4b98..033ae6f 100644 --- a/tests/sqlparser_postgres.rs +++ b/tests/sqlparser_postgres.rs @@ -3335,7 +3335,7 @@ fn parse_create_function() { let sql = r#"CREATE OR REPLACE FUNCTION increment(i INTEGER) RETURNS INTEGER LANGUAGE plpgsql AS $$ BEGIN RETURN i + 1; END; $$"#; assert_eq!( - pg().verified_stmt(sql), + pg_and_generic().verified_stmt(sql), Statement::CreateFunction { or_replace: true, temporary: false,
The text was updated successfully, but these errors were encountered:
Add support for $$ in generic dialect ...
9f8adaf
... in `create function` closes apache#1183
e2ecf89
Successfully merging a pull request may close this issue.
At the moment generic dialect does not support
$$
inCREATE FUNCTION .. AS
, would it make sense supporting it?It should be straight forward adding support for it
The text was updated successfully, but these errors were encountered: