You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
SQL queries generated for DELETE commands include an unnecessary duplicate space between DELETE and FROM. This can be seen from emitting the corresponding strings in walk_ast():
The trailing space can safely be omitted here because self.from_clause.walk_ast() always contributes a leading space itself, leading to duplication, in its own walk_ast() method:
Since DELETE is always followed by FROM —self.from_clause is not optional and must always be emitted—, the trailing space is not necessary, similar to how INSERT commands are prepared without trailing space (because they are always followed by INTO ):
Setup
Versions
Feature Flags
r2d2
,returning_clauses_for_sqlite_3_35
,sqlite
,uuid
Problem Description
SQL queries generated for DELETE commands include an unnecessary duplicate space between
DELETE
andFROM
. This can be seen from emitting the corresponding strings inwalk_ast()
:diesel/diesel/src/query_builder/delete_statement/mod.rs
Lines 261 to 267 in b705023
The trailing space can safely be omitted here because
self.from_clause.walk_ast()
always contributes a leading space itself, leading to duplication, in its ownwalk_ast()
method:diesel/diesel/src/query_builder/from_clause.rs
Lines 128 to 131 in b705023
Since
DELETE
is always followed byFROM
—self.from_clause
is not optional and must always be emitted—, the trailing space is not necessary, similar to how INSERT commands are prepared without trailing space (because they are always followed byINTO
):diesel/diesel/src/query_builder/insert_statement/mod.rs
Lines 488 to 491 in b705023
What are you trying to accomplish?
Issue clean, beautiful SQL queries.
What is the expected output?
DELETE FROM "table"
What is the actual output?
DELETE FROM "table"
Are you seeing any additional errors?
No.
Steps to reproduce
Issue a DELETE query as in the following code:
Checklist
closed if this is not the case)
The text was updated successfully, but these errors were encountered: