Skip to content

Commit c41b2bb

Browse files
committed
Fix capitalization of IS NOT NULL
Fixes #872
1 parent 7bc3e83 commit c41b2bb

File tree

3 files changed

+14
-1
lines changed

3 files changed

+14
-1
lines changed

src/languages/duckdb/duckdb.functions.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -659,7 +659,7 @@ export const functions: string[] = [
659659
// Keywords that also need to be listed as functions
660660
'CAST',
661661
'COALESCE',
662-
'NULL',
662+
// 'NULL', we really prefer treating it as keyword
663663
'RANK',
664664
'ROW_NUMBER',
665665
];

src/languages/duckdb/duckdb.keywords.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ export const keywords: string[] = [
4343
'INITIALLY',
4444
'INTERSECT',
4545
'INTO',
46+
'IS', // additional
4647
'LATERAL',
4748
'LEADING',
4849
'LIMIT',

test/duckdb.test.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -202,4 +202,16 @@ describe('DuckDBFormatter', () => {
202202
})
203203
).toBe('CREATE TABLE foo (bar JSON, baz JSON);');
204204
});
205+
206+
// Issue #872
207+
it('capitalizes IS NOT NULL', () => {
208+
expect(
209+
format(`SELECT 1 is not null;`, {
210+
keywordCase: 'upper',
211+
})
212+
).toBe(dedent`
213+
SELECT
214+
1 IS NOT NULL;
215+
`);
216+
});
205217
});

0 commit comments

Comments
 (0)