This commit is contained in:
qsc
2026-09-06 19:22:56 +08:00
parent a42d3146c5
commit 2cf54a5e6c
18 changed files with 2203 additions and 216 deletions
+6
View File
@@ -37,6 +37,12 @@ class AsyncSQLiteDB:
async with self.conn.execute(sql, params):
await self.conn.commit()
async def execute_affected(self, sql: str, params: Tuple = ()) -> int:
"""执行写入语句并返回受影响的行数。"""
async with self.conn.execute(sql, params) as cursor:
await self.conn.commit()
return cursor.rowcount
async def execute_transaction(
self,
statements: List[Tuple[str, Tuple[Any, ...]]],