Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rewrite sqlvet using analysis.Analyzer? #7

Open
yasushi-saito opened this issue Dec 3, 2021 · 4 comments
Open

rewrite sqlvet using analysis.Analyzer? #7

yasushi-saito opened this issue Dec 3, 2021 · 4 comments

Comments

@yasushi-saito
Copy link

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 to detect SQL statements:

https://agniva.me/vet/2019/01/21/vet-analyzer.html

Does it make sense to rewrite sqlvet using it? I can try my hand over the holidays if you think it's a good idea.

@houqp
Copy link
Owner

houqp commented Dec 3, 2021

I am all for rewriting sqlvet with a new design that can yield better performance, so feel free to give it a try ;)

As for checking the entire main package, isn't it what we always want to do so we don't miss SQL statements in main?

@yasushi-saito
Copy link
Author

Well, we sometimes want to check just a specific set of files. For example, we are using this tool in a git pre-commit hook. In such a case, it's better to check only the changed files.

@houqp
Copy link
Owner

houqp commented Dec 3, 2021

Got it, that makes sense :)

@yasushi-saito
Copy link
Author

#8 is a first cut.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants