-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
Ensure that semicolon is not appended to statements that already end with a semicolon #4052
Conversation
Thanks! Could you please add test for this? Also CI seems to be failing. |
Of course, in reality this does not seem to be the solution, I will take a closer look. |
Well, I believe it will now work as expected. But I don't know where to put the tests. This specific case would be testing whether converting a set of queries, some ending with semicolons, would work as expected, with all of them ending with just one semicolon, except the last, where nothing would be appended. The query builder already has tests to verify that most queries are converted correctly, the schema builder does not and that would require refactoring a lot for such a small adjustment I think. It is not something strongly related to a dialect, nor to the query builder, nor to the schema builder and nor a specific statement. What do you think? |
@guicovred Is it possible to write an integration test that would have been failing prior to this change, but no longer does after it? |
Ok, this is possible. I was thinking about something more generic before. I added the test. Thanks! |
It seems that these new failed CI tests was introduced by nodejs v14.13 (20 hours ago). esm-interop.spec.js#L164 and esm-interop.spec.js#L179 Apparently the exception is from here: lexer.js#L892 |
@guicovred Please pull from master, that should fix it. |
Done. Thanks! |
@kibertoad Is there still anything I can do to get it merged? |
Thanks a lot! |
I thank you! |
This solves #4045:
toQuery()
&toSql()
are returning duplicate semicolons for queries that pass through the methodwrapSqlWithCatch()
Example:
outputs: