Skip to content

Commit 595b3df

Browse files
committed
Disable $named params support in favor of $$-strings
1 parent 9b2be86 commit 595b3df

File tree

3 files changed

+5
-4
lines changed

3 files changed

+5
-4
lines changed

src/languages/duckdb/duckdb.formatter.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,8 @@ export const duckdb: DialectOptions = {
163163
],
164164
identTypes: [`""-qq`],
165165
identChars: { rest: '$' },
166-
paramTypes: { positional: true, numbered: ['$'], named: ['$'], quoted: ['$'] },
166+
// TODO: named params $foo currently conflict with $$-quoted strings
167+
paramTypes: { positional: true, numbered: ['$'], quoted: ['$'] },
167168
operators: [
168169
// Arithmetic:
169170
'//',

test/duckdb.test.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,8 @@ describe('DuckDBFormatter', () => {
124124
'INTERSECT ALL',
125125
]);
126126
supportsReturning(format);
127-
supportsParams(format, { positional: true, numbered: ['$'], named: ['$'], quoted: ['$""'] });
127+
// TODO: named params $foo currently conflict with $$-quoted strings
128+
supportsParams(format, { positional: true, numbered: ['$'], quoted: ['$""'] });
128129
supportsWindow(format);
129130
supportsLimiting(format, { limit: true, offset: true });
130131
supportsDataTypeCase(format);

test/features/strings.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -272,8 +272,7 @@ export default function supportsStrings(format: FormatFn, stringTypes: StringTyp
272272
`);
273273
});
274274

275-
// TODO: this conflicts with named parameter syntax: $foo
276-
it.skip('supports tagged dollar-quoted strings', () => {
275+
it('supports tagged dollar-quoted strings', () => {
277276
expect(format('$xxx$foo $$ LEFT JOIN $yyy$ bar$xxx$')).toBe(
278277
'$xxx$foo $$ LEFT JOIN $yyy$ bar$xxx$'
279278
);

0 commit comments

Comments
 (0)