Skip to content

Commit b4d574a

Browse files
committed
Support assignment operator in Snowflake
Fixes #775
1 parent f55e3c3 commit b4d574a

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

src/languages/snowflake/snowflake.formatter.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -328,6 +328,8 @@ export const snowflake: DialectOptions = {
328328
'||',
329329
// Generators: https://docs.snowflake.com/en/sql-reference/functions/generator.html#generator
330330
'=>',
331+
// Assignment https://docs.snowflake.com/en/sql-reference/snowflake-scripting/let
332+
':=',
331333
],
332334
propertyAccessOperators: [':'],
333335
},

test/snowflake.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ describe('SnowflakeFormatter', () => {
5454
supportsIdentifiers(format, [`""-qq`]);
5555
supportsBetween(format);
5656
// ':' and '::' are tested later, since they should always be dense
57-
supportsOperators(format, ['%', '||', '=>'], { any: true });
57+
supportsOperators(format, ['%', '||', '=>', ':='], { any: true });
5858
supportsJoin(format, { without: ['NATURAL INNER JOIN'] });
5959
supportsSetOperations(format, ['UNION', 'UNION ALL', 'MINUS', 'EXCEPT', 'INTERSECT']);
6060
supportsLimiting(format, { limit: true, offset: true, fetchFirst: true, fetchNext: true });

0 commit comments

Comments
 (0)