Execute a SQL statement expecting success (no result needed).
(&self, sql: &str)
| 110 | |
| 111 | /// Execute a SQL statement expecting success (no result needed). |
| 112 | pub async fn exec(&self, sql: &str) -> Result<(), String> { |
| 113 | let client = self.client.as_ref(); |
| 114 | match client.simple_query(sql).await { |
| 115 | Ok(_) => Ok(()), |
| 116 | Err(e) => Err(pg_error_detail(&e)), |
| 117 | } |
| 118 | } |
| 119 | |
| 120 | /// Open a second pgwire connection on the same listener under a different |
| 121 | /// username. Returns a client and its background connection task handle. |