Skip to content

Commit

Permalink
Remove ODBC keywords from Transact-SQL keywords list
Browse files Browse the repository at this point in the history
Refs #819
  • Loading branch information
nene committed Jan 2, 2025
1 parent df4c535 commit 5404197
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 112 deletions.
112 changes: 0 additions & 112 deletions src/languages/transactsql/transactsql.keywords.ts
Original file line number Diff line number Diff line change
Expand Up @@ -177,118 +177,6 @@ export const keywords: string[] = [
'WITH',
'WITHIN GROUP',
'WRITETEXT',

// odbc
'ABSOLUTE',
'ACTION',
'ADA',
'ALLOCATE',
'ARE',
'ASSERTION',
'AT',
'AVG',
'BIT_LENGTH',
'BOTH',
'CASCADED',
'CAST',
'CATALOG',
'CHARACTER_LENGTH',
'CHAR_LENGTH',
'COLLATION',
'CONNECT',
'CONNECTION',
'CONSTRAINTS',
'CORRESPONDING',
'COUNT',
'DAY',
'DEFERRABLE',
'DEFERRED',
'DESCRIBE',
'DESCRIPTOR',
'DIAGNOSTICS',
'DISCONNECT',
'DOMAIN',
'END-EXEC',
'EXCEPTION',
'EXTRACT',
'FALSE',
'FIRST',
'FORTRAN',
'FOUND',
'GET',
'GLOBAL',
'GO',
'HOUR',
'IMMEDIATE',
'INCLUDE',
'INDICATOR',
'INITIALLY',
'INPUT',
'INSENSITIVE',
'INTERVAL',
'ISOLATION',
'LANGUAGE',
'LAST',
'LEADING',
'LEVEL',
'LOCAL',
'LOWER',
'MATCH',
'MAX',
'MIN',
'MINUTE',
'MODULE',
'MONTH',
'NAMES',
'NATURAL',
'NEXT',
'NO',
'NONE',
'OCTET_LENGTH',
'ONLY',
'OUTPUT',
'OVERLAPS',
'PAD',
'PARTIAL',
'PASCAL',
'POSITION',
'PREPARE',
'PRESERVE',
'PRIOR',
'PRIVILEGES',
'RELATIVE',
'ROWS',
'SCROLL',
'SECOND',
'SECTION',
'SESSION',
'SIZE',
'SPACE',
'SQL',
'SQLCA',
'SQLCODE',
'SQLERROR',
'SQLSTATE',
'SQLWARNING',
'SUBSTRING',
'SUM',
'TEMPORARY',
'TIMEZONE_HOUR',
'TIMEZONE_MINUTE',
'TRAILING',
'TRANSLATE',
'TRANSLATION',
'TRIM',
'TRUE',
'UNKNOWN',
'UPPER',
'USAGE',
'VALUE',
'WHENEVER',
'WORK',
'WRITE',
'YEAR',
'ZONE',
// https://learn.microsoft.com/en-us/sql/t-sql/queries/output-clause-transact-sql?view=sql-server-ver16#action
'$ACTION',
];
Expand Down
9 changes: 9 additions & 0 deletions test/transactsql.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -218,4 +218,13 @@ describe('TransactSqlFormatter', () => {
CREATE INDEX bar
`);
});

// Issue #819
it('does not recognize ODBC keywords as reserved keywords', () => {
expect(format(`SELECT Value, Zone`, { keywordCase: 'upper' })).toBe(dedent`
SELECT
Value,
Zone
`);
});
});

0 comments on commit 5404197

Please sign in to comment.