(self)
| 69 | return (await cursor.fetchone())[0] |
| 70 | |
| 71 | async def db_delete(self) -> None: |
| 72 | if not self.database: |
| 73 | return |
| 74 | await self.create_connection(with_db=False) |
| 75 | database = self.database |
| 76 | sql = ( |
| 77 | f"IF DB_ID(N'{database}') IS NOT NULL " |
| 78 | "BEGIN " |
| 79 | f"ALTER DATABASE [{database}] SET SINGLE_USER WITH ROLLBACK IMMEDIATE; " |
| 80 | f"DROP DATABASE [{database}]; " |
| 81 | "END" |
| 82 | ) |
| 83 | await self.execute_script(sql) |
| 84 | await self.close() |
| 85 | |
| 86 | |
| 87 | def _gen_savepoint_name(_c=count()) -> str: |
nothing calls this directly
no test coverage detected