-
Notifications
You must be signed in to change notification settings - Fork 423
feat: support multiple statements #58
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
Conversation
Hi @rafaelrpinto, thanks for a patch! Proper multiple-query support is something we definitely need. It's nice that you have thought about potential backwards-compatibility issues. But I think we're better off not preserving the current (buggy) formatting of semicolons. Unless the whitespace in input SQL is somehow significant, it should not effect the output. Breaking up a chain of SQL statements on a single line is something one would expect a formatter to do. Would you be interested in changing this pull request so that Also, I suggest we rename |
PS. Also, it looks that your git config is missing author name. I see:
|
@nene Since we will simply consider the semicolon as line break always I rolled back most of the changes and took a simplified approach without creating any token types. Please let me know if that was what you had in mind. Thanks. |
Thanks. Look great! I'll merge this and hopefully will also release soonish (I'd like to also eliminate a security alert I'm getting because of an outdated dev-dependency). |
Bump for release :) |
This PR attempts to improve formatting of multiple statement SQLs like it was discussed in here: #50
Basically we keep the semicolon formatting as is unless its followed by one or more line breaks and have another statement after it. In that case we preserve one line break between the statements.
I think this allows some formatting of multiple statements without interfering with the existing behaviour.