Skip to content

Commit b859914

Browse files
authored
QueryBuilder: add debug_assert when push_values is passed an empty set of tuples (#3734)
* throw a warning in tracing so that the empty tuples would be noticed * use debug assertion to throw a panic in debug mode
1 parent 3a20a92 commit b859914

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

Cargo.lock

-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

sqlx-core/src/query_builder.rs

+5
Original file line numberDiff line numberDiff line change
@@ -323,6 +323,11 @@ where
323323
separated.push_unseparated(")");
324324
}
325325

326+
debug_assert!(
327+
separated.push_separator,
328+
"No value being pushed. QueryBuilder may not build correct sql query!"
329+
);
330+
326331
separated.query_builder
327332
}
328333

0 commit comments

Comments
 (0)