Skip to content

Commit 4cec5e9

Browse files
committed
Support SELECT .. OPTION () clause
Fixes #705
1 parent e053486 commit 4cec5e9

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

src/languages/transactsql/transactsql.formatter.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ const reservedClauses = expandPhrases([
1818
'ORDER BY',
1919
'OFFSET',
2020
'FETCH {FIRST | NEXT}',
21+
'OPTION',
2122
// Data manipulation
2223
// - insert:
2324
'INSERT [INTO]',

test/transactsql.test.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,16 @@ describe('TransactSqlFormatter', () => {
138138
`);
139139
});
140140

141+
it('formats SELECT ... OPTIONS ()', () => {
142+
const result = format('SELECT col OPTIONS (MAXRECURSION 5)');
143+
expect(result).toBe(dedent`
144+
SELECT
145+
col
146+
OPTION
147+
(MAXRECURSION 5)
148+
`);
149+
});
150+
141151
it('formats goto labels', () => {
142152
const result = format(
143153
`InfiniLoop:

0 commit comments

Comments
 (0)