sqlfluff / vscode-sqlfluff

An extension to use the sqlfluff linter in vscode.
https://marketplace.visualstudio.com/items?itemName=dorzey.vscode-sqlfluff
MIT License
156 stars 33 forks source link

Lint embedded queries #160

Open musjj opened 1 month ago

musjj commented 1 month ago

It would be nice if you can lint/auto-fix query strings embedded in other languages.

For example, in Rust:

sqlx::query("SELECT * FROM users WHERE email = ?")

Or in Go:

db.QueryRow("SELECT (quantity >= ?) from album where id = ?")
RobertOstermann commented 1 month ago

Seems like a request for the actual sqlfluff repo. Or does the command line tool already allow this? This repo just handles the extension.

musjj commented 1 month ago

I was thinking of making the issue on the main repo, but it looks like that the maintainer thinks that it should be implemented by other tools:

I think it'd be more appropriate to look at implementing this as a separate package that uses SQLFluff.

So I thought that maybe the vscode plugin would be appropriate place for this, though I do agree that implementing it in sqlfluff itself would be the most ideal.

The issue is from 2022, so not sure if the maintainers have changed their minds since then.

RobertOstermann commented 1 month ago

Ok, this is probably not something I would fix. If you want to create a PR for it I would look it over and help get it merged and published.