mirror of
https://github.com/simplex-chat/simplex-chat.git
synced 2026-04-15 15:55:48 +00:00
* core: entity locks * more locks * update sha256map * add delay * clean up * empty * fix tests * empty * empty * more delays * empty * comment delays * Revert "comment delays" This reverts commit4245b545fb. * Revert "Revert "comment delays"" This reverts commitf803386945. * take lock in the beginning of processing loop * empty * empty * remove lock * rework file locks * empty * fix * empty * add connection locks * empty * fix test * empty * remove commented delays * add to debug locks * update * refactor * refactor --------- Co-authored-by: Evgeny Poberezkin <evgeny@poberezkin.com>
30 lines
926 B
Haskell
30 lines
926 B
Haskell
module Simplex.Chat.Store
|
|
( SQLiteStore,
|
|
StoreError (..),
|
|
ChatLockEntity (..),
|
|
UserMsgReceiptSettings (..),
|
|
UserContactLink (..),
|
|
AutoAccept (..),
|
|
createChatStore,
|
|
migrations, -- used in tests
|
|
chatStoreFile,
|
|
agentStoreFile,
|
|
withTransaction,
|
|
)
|
|
where
|
|
|
|
import Data.ByteArray (ScrubbedBytes)
|
|
import Simplex.Chat.Store.Migrations
|
|
import Simplex.Chat.Store.Profiles
|
|
import Simplex.Chat.Store.Shared
|
|
import Simplex.Messaging.Agent.Store.SQLite (MigrationConfirmation, MigrationError, SQLiteStore (..), createSQLiteStore, withTransaction)
|
|
|
|
createChatStore :: FilePath -> ScrubbedBytes -> Bool -> MigrationConfirmation -> IO (Either MigrationError SQLiteStore)
|
|
createChatStore dbPath key keepKey = createSQLiteStore dbPath key keepKey migrations
|
|
|
|
chatStoreFile :: FilePath -> FilePath
|
|
chatStoreFile = (<> "_chat.db")
|
|
|
|
agentStoreFile :: FilePath -> FilePath
|
|
agentStoreFile = (<> "_agent.db")
|