sqlx icon indicating copy to clipboard operation
sqlx copied to clipboard

Merge / append / concatenate two `QueryBuilder`s?

Open frederikhors opened this issue 1 year ago • 1 comments

I have many sqlx::QueryBuilder, can I merge them together?

Example:

let first: QueryBuilder<'a, sqlx::Postgres> = QueryBuilder::new(r"1 ");

let mut third = QueryBuilder::new(" 3");

first.push(" 2");

first.append(third) // append() doesn't exists

assert_eq!(first.sql(), "1 2 3");

Is this possible today somewhat?

frederikhors avatar Jan 29 '24 21:01 frederikhors

Would also love to see this. I'm guessing the hairiest part is fixing the bind arguments?

Dunedubby avatar May 16 '25 15:05 Dunedubby