sqlc-dev / sqlc

Generate type-safe code from SQL
https://sqlc.dev
MIT License
13.54k stars 809 forks source link

Allow selective disabling of rules per query #3620

Open rhodeon opened 1 month ago

rhodeon commented 1 month ago

This resolves #3619 and has some minor refactor in regards to reusable constants.

As mentioned there, the @sqlc-vet-disable query annotation now accepts a list of rules to skip:

/* @sqlc-vet-disable sqlc/db-prepare no-pg */

Providing just /* @sqlc-vet-disable */ without any parameters retains the previous behaviour of skipping all rules for a query.

rhodeon commented 1 month ago

@kyleconroy, can you please confirm if this is something worth having? We have quite a few queries which benefit from it.