Title: Allow selective disabling of rules per query · Issue #3619 · sqlc-dev/sqlc · GitHub
Open Graph Title: Allow selective disabling of rules per query · Issue #3619 · sqlc-dev/sqlc
X Title: Allow selective disabling of rules per query · Issue #3619 · sqlc-dev/sqlc
Description: What do you want to change? Currently, the only way to disable the vetting of rules for a query is with the @sqlc-vet-disable flag. The problem with this is that it is an "all-or-nothing" approach. When provided, that flag disables the v...
Open Graph Description: What do you want to change? Currently, the only way to disable the vetting of rules for a query is with the @sqlc-vet-disable flag. The problem with this is that it is an "all-or-nothing" approach....
X Description: What do you want to change? Currently, the only way to disable the vetting of rules for a query is with the @sqlc-vet-disable flag. The problem with this is that it is an "all-or-nothing"...
Opengraph URL: https://github.com/sqlc-dev/sqlc/issues/3619
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Allow selective disabling of rules per query","articleBody":"### What do you want to change?\r\n\r\nCurrently, the only way to [disable the vetting of rules](https://docs.sqlc.dev/en/stable/howto/vet.html#opting-out-of-lint-rules) for a query is with the `@sqlc-vet-disable` flag.\r\nThe problem with this is that it is an \"all-or-nothing\" approach. When provided, that flag disables the vetting of all rules for the query including some which might be needed.\r\nIt would be good to be able to provide a list of rules to skip, like: \r\n``` sqlc\r\n/* @sqlc-vet-disable sqlc/db-prepare no-exec */\r\n```\r\n\r\nIn this case, only the 2 listed rules in the comment would be skipped, but all others would run.\r\nWhen no rule is provided, the flag should disable all rules in the query, just like the current behaviour, for backwards-compatibility.\r\n\r\n#### Use Case\r\nI have a basic `no-delete-without-where` rule which needs to be disabled for a few queries, but the current way to do that involves skipping all rules for the affected queries.\r\n\r\n### What database engines need to be changed?\r\n\r\nPostgreSQL, MySQL, SQLite\r\n\r\n### What programming language backends need to be changed?\r\n\r\n_No response_","author":{"url":"https://github.com/rhodeon","@type":"Person","name":"rhodeon"},"datePublished":"2024-09-28T21:33:00.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":0},"url":"https://github.com/3619/sqlc/issues/3619"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:cc8c8af9-61b9-550a-952c-2fef91f6f05a |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | A1D8:6F3CF:6E01015:9A242BD:6A5061A7 |
| html-safe-nonce | ad6d97d9728108ab9c021f71080ca6ff60146d0bf463beb5fe8d4c7600cb0a85 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBMUQ4OjZGM0NGOjZFMDEwMTU6OUEyNDJCRDo2QTUwNjFBNyIsInZpc2l0b3JfaWQiOiIyNTQyMDAyMzgwNDczMzkzNTc1IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | fe66f11b82e26a71ae32af2dbf579f9de90c0cae452218f784467cbee1d139b9 |
| hovercard-subject-tag | issue:2554513657 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/sqlc-dev/sqlc/3619/issue_layout |
| twitter:image | https://opengraph.githubassets.com/ac3ab1951957ad63abbcece91d0205efb230683fc4f59387fd445bfe30bbba4e/sqlc-dev/sqlc/issues/3619 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/ac3ab1951957ad63abbcece91d0205efb230683fc4f59387fd445bfe30bbba4e/sqlc-dev/sqlc/issues/3619 |
| og:image:alt | What do you want to change? Currently, the only way to disable the vetting of rules for a query is with the @sqlc-vet-disable flag. The problem with this is that it is an "all-or-nothing" approach.... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | rhodeon |
| hostname | github.com |
| expected-hostname | github.com |
| None | d6dc8294eb500fa36bbc57472d61fe87c522f9c3c1d64f70f4926f66a66a7efb |
| turbo-cache-control | no-preview |
| go-import | github.com/sqlc-dev/sqlc git https://github.com/sqlc-dev/sqlc.git |
| octolytics-dimension-user_id | 136738596 |
| octolytics-dimension-user_login | sqlc-dev |
| octolytics-dimension-repository_id | 193160679 |
| octolytics-dimension-repository_nwo | sqlc-dev/sqlc |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 193160679 |
| octolytics-dimension-repository_network_root_nwo | sqlc-dev/sqlc |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 7ac0ad2f2c7e4b9056617355fd9e33e22b0c8df9 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width