Skip to content

Add support for $$ in generic dialect ... #1185

New issue

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

Merged
merged 2 commits into from
Mar 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/parser/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5954,7 +5954,8 @@ 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))
}
Expand Down
2 changes: 1 addition & 1 deletion tests/sqlparser_postgres.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3305,7 +3305,7 @@ fn parse_create_function() {

let sql = "CREATE OR REPLACE FUNCTION add(a INTEGER, IN b INTEGER = 1) RETURNS INTEGER LANGUAGE SQL IMMUTABLE RETURN a + b";
assert_eq!(
pg().verified_stmt(sql),
pg_and_generic().verified_stmt(sql),
Statement::CreateFunction {
or_replace: true,
temporary: false,
Expand Down