Skip to content

Commit

Permalink
Treat $ACTION as keyword in Transact-SQL
Browse files Browse the repository at this point in the history
Fixes #810
  • Loading branch information
nene committed Dec 21, 2024
1 parent 0d39810 commit 1359634
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/languages/transactsql/transactsql.keywords.ts
Original file line number Diff line number Diff line change
Expand Up @@ -289,6 +289,8 @@ export const keywords: string[] = [
'WRITE',
'YEAR',
'ZONE',
// https://learn.microsoft.com/en-us/sql/t-sql/queries/output-clause-transact-sql?view=sql-server-ver16#action
'$ACTION',
];

export const dataTypes: string[] = [
Expand Down
8 changes: 8 additions & 0 deletions test/transactsql.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -197,4 +197,12 @@ describe('TransactSqlFormatter', () => {
CREATE TABLE foo (name char(65));
`);
});

// Issue #810
it('supports special $ACTION keyword', () => {
expect(format(`MERGE INTO tbl OUTPUT $action AS act;`)).toBe(dedent`
MERGE INTO
tbl OUTPUT $action AS act;
`);
});
});

0 comments on commit 1359634

Please sign in to comment.