sqlvet
sqlvet copied to clipboard
Go fearless SQL. Sqlvet performs static analysis on raw SQL queries in your Go code base.
I just ran into an issue with one of my queries and it seems sqlvet cannot handle this sort of Update-Query: ``` UPDATE activities u SET ref_id = c.ref_id FROM...
Use golang.org/x/tools/go/analysis framework. It's simpler, faster. It also allows analyzing individual packages, not the whole program. As a simple benchmark, running the sqlvet (old or new) on a 100kloc source...
The current sqlvet requires full parsing of the entire main package(s), so it becomes pretty slow for a large codebase. There's conveniently an article about using "go vet"'s analysis.Analyzer framework...
Upgrade Go version to 1.18 and upgrade golang.org/x/tools package. This is needed as `sqlvet` gave errors while vetting the Go 1.18 generics code. Upgrading the `golang.org/x/tools` fixes the error. Below...
golangci-lint is a cool metalinter which makes it easy to include lots of popular Go linters in a build process. There are [lots of linters supported already](https://golangci-lint.run/usage/linters/) but I didn't...
I was just checking a PR in that big codebase I needed this linter for and in lieu of actually fixing everything that gets flagged I was using a version...
When using the binary from the release page or building `master` from the source, the command fails when a schema has not been specified: ``` [!] No schema specified, will...
As of the newest commit, `go.mod` has: https://github.com/houqp/sqlvet/blob/5f05ce8ee30db3e0b2bd1ba6786ee20bdfc7d7da/go.mod#L9 However, `v1.1.8` (aka `latest`) still has: https://github.com/houqp/sqlvet/blob/de3040a06e0198e67a8ebcaba67095c601f42d81/go.mod#L9 This version of `pg_query_go` leads to the following compilation error: ```sh $ go install github.com/houqp/sqlvet@latest...
Queries with `(?)` are not valid since updated version from `1.1.6` to `1.1.7/1.1.8`, doesn't depend on go version ``` SELECT id FROM my_table WHERE id IN (?); ``` Getting `ERROR:...
Install with with Go 1.25 fails: ``` go install github.com/houqp/[email protected] 21:09:08 # golang.org/x/tools/internal/tokeninternal go/pkg/mod/golang.org/x/[email protected]/internal/tokeninternal/tokeninternal.go:78:9: invalid array length -delta * delta (constant -256 of type int64) ``` Looks like golang.org/x/tools just...