Skip to content

Commit e38e435

Browse files
add batch_execute to generic client
1 parent 0c05614 commit e38e435

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

tokio-postgres/src/generic_client.rs

+12
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,10 @@ pub trait GenericClient: private::Sealed {
6969
/// Like `Client::transaction`.
7070
async fn transaction(&mut self) -> Result<Transaction<'_>, Error>;
7171

72+
/// Like `Client::batch_execute`.
73+
async fn batch_execute(&self, query: &str) -> Result<(), Error>;
74+
75+
7276
/// Returns a reference to the underlying `Client`.
7377
fn client(&self) -> &Client;
7478
}
@@ -149,6 +153,10 @@ impl GenericClient for Client {
149153
self.transaction().await
150154
}
151155

156+
async fn batch_execute(&self, query: &str) -> Result<(), Error> {
157+
self.batch_execute(query).await
158+
}
159+
152160
fn client(&self) -> &Client {
153161
self
154162
}
@@ -232,6 +240,10 @@ impl GenericClient for Transaction<'_> {
232240
self.transaction().await
233241
}
234242

243+
async fn batch_execute(&self, query: &str) -> Result<(), Error> {
244+
self.batch_execute(query).await
245+
}
246+
235247
fn client(&self) -> &Client {
236248
self.client()
237249
}

0 commit comments

Comments
 (0)