split delete transaction (#620)

This commit is contained in:
JRoberts
2022-05-08 22:03:45 +04:00
committed by GitHub
parent 58b37bf114
commit ca4d1910db
+3 -1
View File
@@ -429,7 +429,7 @@ getContactGroupNames st userId Contact {contactId} =
deleteContact :: MonadUnliftIO m => SQLiteStore -> UserId -> Contact -> m ()
deleteContact st userId Contact {contactId, localDisplayName} = do
liftIO $ putStrLn "in deleteContact, liftIO . withTransaction st $ \\db -> do"
liftIO $ putStrLn "in deleteContact, first liftIO . withTransaction st $ \\db -> do"
liftIO . withTransaction st $ \db -> do
liftIO $ putStrLn "DB.execute DELETE FROM connections WHERE connection_id IN ..."
DB.execute
@@ -445,6 +445,8 @@ deleteContact st userId Contact {contactId, localDisplayName} = do
(userId, contactId)
liftIO $ putStrLn "DB.execute db \"DELETE FROM files WHERE user_id = ? AND contact_id = ?\" (userId, contactId)"
DB.execute db "DELETE FROM files WHERE user_id = ? AND contact_id = ?" (userId, contactId)
liftIO $ putStrLn "in deleteContact, second liftIO . withTransaction st $ \\db -> do"
liftIO . withTransaction st $ \db -> do
liftIO $ putStrLn "DB.execute db \"DELETE FROM chat_items WHERE user_id = ? AND contact_id = ?\" (userId, contactId)"
DB.execute db "DELETE FROM chat_items WHERE user_id = ? AND contact_id = ?" (userId, contactId)
liftIO $ putStrLn "DB.execute db \"DELETE FROM contacts WHERE user_id = ? AND contact_id = ?\" (userId, contactId)"