observablehq / feedback

Customer submitted bugs and feature requests

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

SQL cells should ignore commented interpolated parameters

nachocab opened this issue · comments

On a SQL cell like this one, commenting an interpolated parameter should not give an error:

CleanShot 2023-07-28 at 14 18 33@2x

I don't think we can prevent that, as it would require parsing the query syntax to determine where the interpolation happens.

I understand, but remember that comments in SQL are easier than in JS. It would be as simple as running this regex: query.replace(/--.+/g, '')

No, multiline comments (/* ... */) are also supported.

Oh, I didn't know that. Anyway, handling single line comments would be already be an improvement