Runs a prepared query and returns the number of affected rows.
(
client: &C,
statement: &Statement,
params: &[&(dyn ToSql + Sync)],
)
| 106 | |
| 107 | /// Runs a prepared query and returns the number of affected rows. |
| 108 | pub async fn execute_prepared<C: GenericClient + Sync>( |
| 109 | client: &C, |
| 110 | statement: &Statement, |
| 111 | params: &[&(dyn ToSql + Sync)], |
| 112 | ) -> Result<u64, PostgresError> { |
| 113 | Ok(client.execute(statement, params).await?) |
| 114 | } |
| 115 | |
| 116 | /// Runs one or more SQL statements with no returned rows. |
| 117 | pub async fn batch_execute<C: GenericClient + Sync>( |