From f7ce8fd9f4ad231dd87b8d07e51d0c9f3b01ecc5 Mon Sep 17 00:00:00 2001 From: Johannes Date: Sat, 15 Jul 2023 01:28:14 +0200 Subject: [PATCH] Implement Default for QueryBuilder (#2605) --- sqlx-core/src/query_builder.rs | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/sqlx-core/src/query_builder.rs b/sqlx-core/src/query_builder.rs index accf73e9a6..5f2c28baad 100644 --- a/sqlx-core/src/query_builder.rs +++ b/sqlx-core/src/query_builder.rs @@ -30,6 +30,16 @@ where arguments: Option<>::Arguments>, } +impl<'args, DB: Database> Default for QueryBuilder<'args, DB> { + fn default() -> Self { + QueryBuilder { + init_len: 0, + query: String::default(), + arguments: Some(Default::default()), + } + } +} + impl<'args, DB: Database> QueryBuilder<'args, DB> where DB: Database,