@@ -72,6 +72,11 @@ flag client_postgres
7272 manual : True
7373 default : False
7474
75+ flag server_postgres
76+ description : Build server with support of PostgreSQL.
77+ manual : True
78+ default : False
79+
7580library
7681 exposed-modules :
7782 Simplex.FileTransfer.Agent
@@ -101,6 +106,7 @@ library
101106 Simplex.Messaging.Agent.Store.Interface
102107 Simplex.Messaging.Agent.Store.Migrations
103108 Simplex.Messaging.Agent.Store.Migrations.App
109+ Simplex.Messaging.Agent.Store.Postgres.Options
104110 Simplex.Messaging.Agent.Store.Shared
105111 Simplex.Messaging.Agent.TRcvQueues
106112 Simplex.Messaging.Client
@@ -124,6 +130,7 @@ library
124130 Simplex.Messaging.Parsers
125131 Simplex.Messaging.Protocol
126132 Simplex.Messaging.Server.Expiration
133+ Simplex.Messaging.Server.QueueStore.Postgres.Config
127134 Simplex.Messaging.Server.QueueStore.QueueInfo
128135 Simplex.Messaging.ServiceScheme
129136 Simplex.Messaging.Session
@@ -148,16 +155,9 @@ library
148155 Simplex.RemoteControl.Types
149156 if flag(client_postgres)
150157 exposed-modules :
151- Simplex.Messaging.Agent.Store.Postgres
152- Simplex.Messaging.Agent.Store.Postgres.Common
153- Simplex.Messaging.Agent.Store.Postgres.DB
154- Simplex.Messaging.Agent.Store.Postgres.Migrations
155158 Simplex.Messaging.Agent.Store.Postgres.Migrations.App
156159 Simplex.Messaging.Agent.Store.Postgres.Migrations.M20241210_initial
157160 Simplex.Messaging.Agent.Store.Postgres.Migrations.M20250203_msg_bodies
158- if !flag(client_library )
159- exposed-modules :
160- Simplex.Messaging.Agent.Store.Postgres.Util
161161 else
162162 exposed-modules :
163163 Simplex.Messaging.Agent.Store.SQLite
@@ -228,18 +228,34 @@ library
228228 Simplex.Messaging.Server.Env.STM
229229 Simplex.Messaging.Server.Information
230230 Simplex.Messaging.Server.Main
231+ Simplex.Messaging.Server.Main.Init
231232 Simplex.Messaging.Server.MsgStore
232233 Simplex.Messaging.Server.MsgStore.Journal
234+ Simplex.Messaging.Server.MsgStore.Journal.SharedLock
233235 Simplex.Messaging.Server.MsgStore.STM
234236 Simplex.Messaging.Server.MsgStore.Types
235237 Simplex.Messaging.Server.NtfStore
236238 Simplex.Messaging.Server.Prometheus
237239 Simplex.Messaging.Server.QueueStore
238240 Simplex.Messaging.Server.QueueStore.STM
241+ Simplex.Messaging.Server.QueueStore.Types
239242 Simplex.Messaging.Server.Stats
240243 Simplex.Messaging.Server.StoreLog
244+ Simplex.Messaging.Server.StoreLog.ReadWrite
241245 Simplex.Messaging.Server.StoreLog.Types
242246 Simplex.Messaging.Transport.WebSockets
247+ if flag(client_postgres) || flag(server_postgres)
248+ exposed-modules :
249+ Simplex.Messaging.Agent.Store.Postgres
250+ Simplex.Messaging.Agent.Store.Postgres.Common
251+ Simplex.Messaging.Agent.Store.Postgres.DB
252+ Simplex.Messaging.Agent.Store.Postgres.Migrations
253+ Simplex.Messaging.Agent.Store.Postgres.Util
254+
255+ if flag(server_postgres)
256+ exposed-modules :
257+ Simplex.Messaging.Server.QueueStore.Postgres
258+ Simplex.Messaging.Server.QueueStore.Postgres.Migrations
243259 other-modules :
244260 Paths_simplexmq
245261 hs-source-dirs :
@@ -308,16 +324,19 @@ library
308324 , process == 1.6. *
309325 , temporary == 1.3. *
310326 , websockets == 0.12. *
311- if flag(client_postgres)
327+ if flag(client_postgres) || flag(server_postgres)
312328 build-depends :
313329 postgresql-libpq >= 0.10.0.0
314330 , postgresql-simple == 0.7. *
315331 , raw-strings-qq == 1.1. *
332+ if flag(client_postgres)
316333 cpp-options : -DdbPostgres
317334 else
318335 build-depends :
319336 direct-sqlcipher == 2.3. *
320337 , sqlcipher-simple == 0.4. *
338+ if flag(server_postgres)
339+ cpp-options : -DdbServerPostgres
321340 if impl(ghc >= 9.6.2 )
322341 build-depends :
323342 bytestring == 0.11. *
@@ -435,7 +454,6 @@ test-suite simplexmq-test
435454 CoreTests.UtilTests
436455 CoreTests.VersionRangeTests
437456 FileDescriptionTests
438- Fixtures
439457 NtfClient
440458 NtfServerTests
441459 RemoteControl
@@ -451,7 +469,10 @@ test-suite simplexmq-test
451469 Static
452470 Static.Embedded
453471 Paths_simplexmq
454- if !flag(client_postgres)
472+ if flag(client_postgres)
473+ other-modules :
474+ Fixtures
475+ else
455476 other-modules :
456477 AgentTests.SchemaDump
457478 AgentTests.SQLiteTests
@@ -473,7 +494,6 @@ test-suite simplexmq-test
473494 , crypton-x509
474495 , crypton-x509-store
475496 , crypton-x509-validation
476- , deepseq == 1.4. *
477497 , directory
478498 , file-embed
479499 , filepath
@@ -487,10 +507,8 @@ test-suite simplexmq-test
487507 , ini
488508 , iso8601-time
489509 , main-tester == 0.2. *
490- , memory
491510 , mtl
492511 , network
493- , process
494512 , QuickCheck == 2.14. *
495513 , random
496514 , silently == 1.2. *
@@ -511,11 +529,15 @@ test-suite simplexmq-test
511529 , yaml
512530 default-language : Haskell2010
513531 if flag(client_postgres)
514- build-depends :
515- postgresql-libpq >= 0.10.0.0
516- , postgresql-simple == 0.7. *
517- , raw-strings-qq == 1.1. *
518532 cpp-options : -DdbPostgres
519533 else
520534 build-depends :
521- sqlcipher-simple
535+ deepseq == 1.4. *
536+ , memory
537+ , process
538+ , sqlcipher-simple
539+ if flag(client_postgres) || flag(server_postgres)
540+ build-depends :
541+ postgresql-simple == 0.7. *
542+ if flag(server_postgres)
543+ cpp-options : -DdbServerPostgres
0 commit comments