Skip to content

Commit 645befe

Browse files
committed
apply all pragmas in one go
1 parent b7d6bcd commit 645befe

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

litequery/core.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -218,8 +218,8 @@ def connect(self):
218218
else:
219219
conn = sqlite3.connect(self.config.database_path, timeout=5)
220220
conn.row_factory = row_factory
221-
for pragma, value in self.PRAGMAS:
222-
conn.execute(f"pragma {pragma} = {value}")
221+
pragmas = (f"pragma {p} = {v}" for p, v in self.PRAGMAS)
222+
conn.executescript(";".join(pragmas))
223223
try:
224224
yield conn
225225
finally:

0 commit comments

Comments
 (0)