Skip to content

Commit 8fe280a

Browse files
committed
Support underscores in Trino numeric literals (#994)
2 parents 223a6ce + 069a2f1 commit 8fe280a

3 files changed

Lines changed: 4 additions & 1 deletion

File tree

‎AUTHORS‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ Josh Flark <joshua.flark@growthloop.com>
3939
Josh Sandler <josh@tonic.ai>
4040
Justin Dane Vallar <jdvallar@gmail.com>
4141
Karl Horky <karl.horky@gmail.com>
42+
Manfred Moser <manfred@simpligility.ca>
4243
Martin Nowak <code@dawg.eu>
4344
Matheus Salmi <mathsalmi@gmail.com>
4445
Matheus Teixeira <matheus.mtxr@gmail.com>

‎src/languages/trino/trino.formatter.ts‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,8 @@ export const trino: DialectOptions = {
155155
// https://trino.io/docs/current/language/reserved.html
156156
identTypes: ['""-qq'],
157157
paramTypes: { positional: true },
158+
// https://trino.io/docs/current/language/types.html#integer
159+
underscoresInNumbers: true,
158160
operators: [
159161
'%',
160162
'->',

‎test/trino.test.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ describe('TrinoFormatter', () => {
3333
const format: FormatFn = (query, cfg = {}) => originalFormat(query, { ...cfg, language });
3434

3535
behavesLikeSqlFormatter(format);
36-
supportsNumbers(format);
36+
supportsNumbers(format, { underscore: true });
3737
supportsComments(format);
3838
supportsCommentOn(format);
3939
supportsCreateView(format, { orReplace: true, materialized: true });

0 commit comments

Comments
 (0)