11
This commit is contained in:
+6
-2
@@ -22,12 +22,16 @@ class AsyncSQLiteDB:
|
||||
await self.close()
|
||||
|
||||
async def connect(self):
|
||||
if self.conn is not None:
|
||||
return
|
||||
self.conn = await aiosqlite.connect(self.db_path)
|
||||
self.conn.row_factory = aiosqlite.Row
|
||||
|
||||
async def close(self):
|
||||
if self.conn:
|
||||
await self.conn.close()
|
||||
connection = self.conn
|
||||
self.conn = None
|
||||
if connection:
|
||||
await connection.close()
|
||||
|
||||
# ======================
|
||||
# 基础执行
|
||||
|
||||
Reference in New Issue
Block a user