feedback
-add comment for the fetchall() that if removed will cause SQLITE_MISUSE
This commit is contained in:
parent
a05c44ad1e
commit
5fcca6ed0c
1 changed files with 2 additions and 1 deletions
|
@ -40,6 +40,7 @@ class AIOSQLite:
|
||||||
|
|
||||||
def executemany(self, sql: str, params: Iterable):
|
def executemany(self, sql: str, params: Iterable):
|
||||||
params = params if params is not None else []
|
params = params if params is not None else []
|
||||||
|
# this fetchall is needed to prevent SQLITE_MISUSE
|
||||||
return self.run(lambda conn: conn.executemany(sql, params).fetchall())
|
return self.run(lambda conn: conn.executemany(sql, params).fetchall())
|
||||||
|
|
||||||
def executescript(self, script: str) -> Awaitable:
|
def executescript(self, script: str) -> Awaitable:
|
||||||
|
@ -584,7 +585,7 @@ class BaseDatabase(SQLiteMixin):
|
||||||
|
|
||||||
async def add_keys(self, account, chain, keys):
|
async def add_keys(self, account, chain, keys):
|
||||||
await self.db.executemany(
|
await self.db.executemany(
|
||||||
"insert into pubkey_address values (?, ?, ?, ?, ?, NULL, 0)",
|
"insert into pubkey_address (address, account, chain, position, pubkey) values (?, ?, ?, ?, ?)",
|
||||||
(
|
(
|
||||||
(pubkey.address, account.public_key.address, chain, position,
|
(pubkey.address, account.public_key.address, chain, position,
|
||||||
sqlite3.Binary(pubkey.pubkey_bytes))
|
sqlite3.Binary(pubkey.pubkey_bytes))
|
||||||
|
|
Loading…
Add table
Reference in a new issue