Skip to content

Commit c885fc8

Browse files
authored
Fix exception when creating aiosqlite connections on aiosqlite==0.22.0 (#2035)
1 parent bec3deb commit c885fc8

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

CHANGELOG.rst

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@ Changelog
1212

1313
0.26.0 (unreleased)
1414
-------------------
15+
Fixed
16+
^^^^^
17+
- Fix exception when creating aiosqlite connections on aiosqlite==0.22.0 (#2035)
1518

1619
0.25
1720
====

tortoise/backends/sqlite/client.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -78,9 +78,7 @@ def __init__(self, file_path: str, **kwargs: Any) -> None:
7878

7979
async def create_connection(self, with_db: bool) -> None:
8080
if not self._connection: # pragma: no branch
81-
self._connection = aiosqlite.connect(self.filename, isolation_level=None)
82-
self._connection.start()
83-
await self._connection._connect()
81+
self._connection = await aiosqlite.connect(self.filename, isolation_level=None)
8482
self._connection._conn.row_factory = sqlite3.Row
8583
for pragma, val in self.pragmas.items():
8684
cursor = await self._connection.execute(f"PRAGMA {pragma}={val}")

0 commit comments

Comments
 (0)