Skip to content

Commit

Permalink
downgrade Pool<Posgres> copy_in_raw/out_row to take &self
Browse files Browse the repository at this point in the history
  • Loading branch information
akiradeveloper committed Nov 12, 2021
1 parent 83363da commit 9764499
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions sqlx-core/src/postgres/copy.rs
Original file line number Diff line number Diff line change
Expand Up @@ -75,10 +75,7 @@ impl Pool<Postgres> {
/// ### Note
/// [PgCopyIn::finish] or [PgCopyIn::abort] *must* be called when finished or the connection
/// will return an error the next time it is used.
pub async fn copy_in_raw(
&mut self,
statement: &str,
) -> Result<PgCopyIn<PoolConnection<Postgres>>> {
pub async fn copy_in_raw(&self, statement: &str) -> Result<PgCopyIn<PoolConnection<Postgres>>> {
PgCopyIn::begin(self.acquire().await?, statement).await
}

Expand All @@ -101,10 +98,7 @@ impl Pool<Postgres> {
///
/// Command examples and accepted formats for `COPY` data are shown here:
/// https://www.postgresql.org/docs/current/sql-copy.html
pub async fn copy_out_raw(
&mut self,
statement: &str,
) -> Result<BoxStream<'static, Result<Bytes>>> {
pub async fn copy_out_raw(&self, statement: &str) -> Result<BoxStream<'static, Result<Bytes>>> {
pg_begin_copy_out(self.acquire().await?, statement).await
}
}
Expand Down

0 comments on commit 9764499

Please sign in to comment.