mirror of
https://github.com/simplex-chat/simplexmq.git
synced 2026-03-30 16:26:02 +00:00
* servers: maintain xor-hash of all associated queue IDs in PostgreSQL (#1615)
* ntf server: maintain xor-hash of all associated queue IDs via PostgreSQL triggers
* smp server: xor hash with triggers
* fix sql and using pgcrypto extension in tests
* track counts and hashes in smp/ntf servers via triggers, smp server stats for service subscription, update SMP protocol to pass expected count and hash in SSUB/NSSUB commands
* agent migrations with functions/triggers
* remove agent triggers
* try tracking service subs in the agent (WIP, does not compile)
* Revert "try tracking service subs in the agent (WIP, does not compile)"
This reverts commit 59e908100d.
* comment
* agent database triggers
* service subscriptions in the client
* test / fix client services
* update schema
* fix postgres migration
* update schema
* move schema test to the end
* use static function with SQLite to avoid dynamic wrapper
22 lines
611 B
Haskell
22 lines
611 B
Haskell
{-# LANGUAGE OverloadedStrings #-}
|
|
|
|
module Fixtures where
|
|
|
|
import Data.ByteString (ByteString)
|
|
import qualified Data.ByteString.Char8 as B
|
|
import Database.PostgreSQL.Simple (ConnectInfo (..), defaultConnectInfo)
|
|
import Simplex.Messaging.Agent.Store.Postgres.Options
|
|
|
|
testDBConnstr :: ByteString
|
|
testDBConnstr = "postgresql://test_agent_user@/test_agent_db"
|
|
|
|
testDBConnectInfo :: ConnectInfo
|
|
testDBConnectInfo =
|
|
defaultConnectInfo {
|
|
connectUser = "test_agent_user",
|
|
connectDatabase = "test_agent_db"
|
|
}
|
|
|
|
testDBOpts :: String -> DBOpts
|
|
testDBOpts schema' = DBOpts testDBConnstr (B.pack schema') 1 True
|