Skip to content

Commit

Permalink
feat: add count and types to merge
Browse files Browse the repository at this point in the history
  • Loading branch information
dgagn committed Dec 22, 2024
1 parent 1c461ed commit 31c6bf4
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion sqlx-core/src/arguments.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ pub trait Arguments<'q>: Send + Sized + Default {
writer.write_str("?")
}

fn merge(&mut self, other: Self);
fn merge(mut self, other: Self);
}

pub trait IntoArguments<'q, DB: Database>: Sized + Send {
Expand Down
3 changes: 3 additions & 0 deletions sqlx-postgres/src/arguments.rs
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,9 @@ impl<'q> Arguments<'q> for PgArguments {
fn merge(&mut self, other: Self) {
self.types.extend(other.types);
self.buffer.extend_from_slice(&other.buffer);
self.buffer.count += other.buffer.count;
self.buffer.patches.extend(other.buffer.patches);
self.buffer.type_holes.extend(other.buffer.type_holes);
}

#[inline(always)]
Expand Down

0 comments on commit 31c6bf4

Please sign in to comment.