Skip to content

Commit

Permalink
Support assignment operator in Snowflake
Browse files Browse the repository at this point in the history
Fixes #775
  • Loading branch information
nene committed Sep 6, 2024
1 parent f55e3c3 commit b4d574a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions src/languages/snowflake/snowflake.formatter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -328,6 +328,8 @@ export const snowflake: DialectOptions = {
'||',
// Generators: https://docs.snowflake.com/en/sql-reference/functions/generator.html#generator
'=>',
// Assignment https://docs.snowflake.com/en/sql-reference/snowflake-scripting/let
':=',
],
propertyAccessOperators: [':'],
},
Expand Down
2 changes: 1 addition & 1 deletion test/snowflake.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ describe('SnowflakeFormatter', () => {
supportsIdentifiers(format, [`""-qq`]);
supportsBetween(format);
// ':' and '::' are tested later, since they should always be dense
supportsOperators(format, ['%', '||', '=>'], { any: true });
supportsOperators(format, ['%', '||', '=>', ':='], { any: true });
supportsJoin(format, { without: ['NATURAL INNER JOIN'] });
supportsSetOperations(format, ['UNION', 'UNION ALL', 'MINUS', 'EXCEPT', 'INTERSECT']);
supportsLimiting(format, { limit: true, offset: true, fetchFirst: true, fetchNext: true });
Expand Down

0 comments on commit b4d574a

Please sign in to comment.