From c7519d2e9cb9e4107f95f6fbf54aac3edda59df0 Mon Sep 17 00:00:00 2001 From: Rene Saarsoo Date: Wed, 2 Nov 2022 13:46:56 +0200 Subject: [PATCH] Support => operator in Trino Used for named function arguments, like in Postgres --- src/languages/trino/trino.formatter.ts | 1 + test/trino.test.ts | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/languages/trino/trino.formatter.ts b/src/languages/trino/trino.formatter.ts index 61be6684b1..6eca1b6790 100644 --- a/src/languages/trino/trino.formatter.ts +++ b/src/languages/trino/trino.formatter.ts @@ -148,6 +148,7 @@ export const trino: DialectOptions = { operators: [ '%', '->', + '=>', ':', '||', // Row pattern syntax diff --git a/test/trino.test.ts b/test/trino.test.ts index bc910184d9..8b316ad61f 100644 --- a/test/trino.test.ts +++ b/test/trino.test.ts @@ -47,7 +47,7 @@ describe('TrinoFormatter', () => { supportsIdentifiers(format, [`""-qq`]); supportsBetween(format); // Missing: '?' operator (for row patterns) - supportsOperators(format, ['%', '->', '||', '|', '^', '$'], ['AND', 'OR']); + supportsOperators(format, ['%', '->', '=>', '||', '|', '^', '$'], ['AND', 'OR']); supportsArrayLiterals(format); supportsArrayAndMapAccessors(format); supportsJoin(format);