Execute a DDL command.
(&self, sql: &str)
| 49 | |
| 50 | /// Execute a DDL command. |
| 51 | pub async fn ddl(&self, sql: &str) -> NodeDbResult<QueryResult> { |
| 52 | let mut conn = self.pool.acquire().await?; |
| 53 | match conn.execute_ddl(sql).await { |
| 54 | Ok(r) => Ok(r), |
| 55 | Err(e) if is_connection_error(&e) => { |
| 56 | drop(conn); |
| 57 | let mut conn = self.pool.acquire().await?; |
| 58 | conn.execute_ddl(sql).await |
| 59 | } |
| 60 | Err(e) => Err(e), |
| 61 | } |
| 62 | } |
| 63 | |
| 64 | /// Begin a transaction. |
| 65 | pub async fn begin(&self) -> NodeDbResult<()> { |
nothing calls this directly
no test coverage detected