-
Notifications
You must be signed in to change notification settings - Fork 120
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
Expose C++ API interface #19
Comments
@robertrossmann Thanks for the feedback! This tool actually is a wrapper around a C++ library ( https://github.com/jarulraj/sqlcheck/blob/master/src/CMakeLists.txt#L13 |
Thanks @jarulraj for your tip! I would definitely use that function to integrate this tool into an editor, however what worries me is that function's output - it's just The optimal interface of that function would be that I give it a string with the SQL and it gives me back some data structure (ie. an array?) with the errors and their position in the string. This way I could format the results for display in any way I need. I could even show a marker in the editor. This will most likely be a non-trivial task should you decide to adopt it. However, I would be ever so grateful! Thanks! |
I see, that's a helpful suggestion. I think that it should not be too hard. I will give it a shot in the near future! |
It would be a great feature to implement some kind of programmatic API to check an SQL file (either from path or from the contents given as argument) so that 3rd party tools can be built around sqlcheck.
My primary interest is to integrate this tool into an editor/IDE for SQL file linting. Currently the only way to integrate this tool into an editor would be to run
shellcheck
as a standard command invocation from shell and parse the output, then map it to the lines and character positions. This approach is not very performant and would require a lot of work, especially in the output parsing logic. However, creating a stanard way to programmatically invoke shellcheck would work perfectly for this use case.Unfortunately I am not proficient enough in C/C++ to send a PR, so leaving this here as a suggestion only. Thank you for considering this feature!
The text was updated successfully, but these errors were encountered: