diff options
| -rw-r--r-- | pypaste/server/sqlite/__init__.py | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/pypaste/server/sqlite/__init__.py b/pypaste/server/sqlite/__init__.py index 3d5e1b1..5cd00a6 100644 --- a/pypaste/server/sqlite/__init__.py +++ b/pypaste/server/sqlite/__init__.py @@ -29,6 +29,8 @@ class Sqlite(Storage): data = await asyncio.to_thread(compress) try: + await self.connection.execute("begin") + await self.connection.execute( "insert into pastes values(?, ?, ?, ?, ?)", ( @@ -95,6 +97,8 @@ class Sqlite(Storage): async def delete(self, key: Key) -> None: try: + await self.connection.execute("begin") + await self.connection.execute("delete from pastes where key=?", (key.data,)) await self.connection.execute( |
