Skip to content

Commit

Permalink
Correct JOIN syntax for DB2 and DB2i
Browse files Browse the repository at this point in the history
  • Loading branch information
nene committed Nov 11, 2023
1 parent 65610d7 commit 434d2f8
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/languages/db2i/db2i.formatter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ const reservedSetOperations = expandPhrases(['UNION [ALL]', 'EXCEPT [ALL]', 'INT
const reservedJoins = expandPhrases([
'JOIN',
'{LEFT | RIGHT | FULL} [OUTER] JOIN',
'{LEFT | RIGHT } EXCEPTION JOIN',
'[LEFT | RIGHT] EXCEPTION JOIN',
'{INNER | CROSS} JOIN',
]);

Expand Down
2 changes: 1 addition & 1 deletion test/db2.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ describe('Db2Formatter', () => {
supportsComments(format);
supportsCreateTable(format);
supportsDropTable(format);
supportsJoin(format, { without: ['NATURAL'], supportsUsing: false });
supportsJoin(format, { without: ['NATURAL'] });
supportsParams(format, { positional: true, named: [':'] });
supportsOperators(format, [
'**',
Expand Down
5 changes: 4 additions & 1 deletion test/db2i.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,10 @@ describe('Db2iFormatter', () => {
supportsComments(format, { nestedBlockComments: true });
supportsCreateTable(format, { orReplace: true });
supportsDropTable(format, { ifExists: true });
supportsJoin(format, { without: ['NATURAL'], supportsUsing: true });
supportsJoin(format, {
without: ['NATURAL'],
additionally: ['EXCEPTION JOIN', 'LEFT EXCEPTION JOIN', 'RIGHT EXCEPTION JOIN'],
});
supportsParams(format, { positional: true });
supportsOperators(format, ['**', '¬=', '¬>', '¬<', '!>', '!<', '||']);
});

0 comments on commit 434d2f8

Please sign in to comment.