sqlx icon indicating copy to clipboard operation
sqlx copied to clipboard

Support for linting queries

Open iJustErikk opened this issue 2 years ago • 1 comments

Linting queries would be a great feature for ensuring quality of queries (for example, discouraging equality check with null).

Creating a general linter would be a very tall order. There are existing tools like sqlfluff. If we could at compile time, and convert the query into something we could pass into sqlfluff, then we could give lint warnings at compile time.

I'd like to make this feature request for now. I'll be more free in a couple weeks to hash out what the warnings should look like and play around with getting this implemented.

iJustErikk avatar Nov 08 '23 01:11 iJustErikk

Did you make any progress with this? Using sqlfluff to lint sqlx queries would be very cool.

musjj avatar Sep 22 '24 14:09 musjj

I've added sqruff support for sqlx via a dylint lint: cargo-sqruff

gvozdvmozgu avatar Jul 04 '25 00:07 gvozdvmozgu