Skip to content

Commit

Permalink
fix(query-engine): fix D1 tracing bug on comments (#4931)
Browse files Browse the repository at this point in the history
* fix(query-engine): fix D1 tracing bug on comments

* fix(quaint): fix test expectations on SQLite
  • Loading branch information
jkomyno authored Jun 24, 2024
1 parent 5677c5d commit d56fe2e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions quaint/src/visitor/sqlite.rs
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ impl<'a> Visitor<'a> for Sqlite<'a> {
self.returning(insert.returning)?;

if let Some(comment) = insert.comment {
self.write("; ")?;
self.write(" ")?;
self.visit_comment(comment)?;
}

Expand Down Expand Up @@ -855,7 +855,7 @@ mod tests {

#[test]
fn test_comment_insert() {
let expected_sql = "INSERT INTO `users` DEFAULT VALUES; /* trace_id='5bd66ef5095369c7b0d1f8f4bd33716a', parent_id='c532cb4098ac3dd2' */";
let expected_sql = "INSERT INTO `users` DEFAULT VALUES /* trace_id='5bd66ef5095369c7b0d1f8f4bd33716a', parent_id='c532cb4098ac3dd2' */";
let query = Insert::single_into("users");
let insert =
Insert::from(query).comment("trace_id='5bd66ef5095369c7b0d1f8f4bd33716a', parent_id='c532cb4098ac3dd2'");
Expand Down

0 comments on commit d56fe2e

Please sign in to comment.