(&mut self)
| 52 | } |
| 53 | |
| 54 | pub async fn close(&mut self) -> Result<(), DbErr> { |
| 55 | // Close existing db, if any |
| 56 | if let Some(db) = self.db.take() { |
| 57 | db.close().await?; // drop it |
| 58 | } |
| 59 | Ok(()) |
| 60 | } |
| 61 | } |
| 62 | |
| 63 | pub async fn create_tables(db: &DbConn) -> Result<(), DbErr> { |