Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
H
haskell-pgmq
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
gargantext
haskell-pgmq
Commits
1728b3d5
Verified
Commit
1728b3d5
authored
Oct 04, 2024
by
Przemyslaw Kaminski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[helpers] safeSendMessage
This is a variant of 'sendMessage' which creates the queue
parent
419fe7d9
Pipeline
#6749
failed with stages
in 2 minutes and 26 seconds
Changes
4
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
11 additions
and
3 deletions
+11
-3
haskell-pgmq.cabal
haskell-pgmq.cabal
+3
-1
PGMQ.hs
src/Database/PGMQ.hs
+3
-1
Simple.hs
src/Database/PGMQ/Simple.hs
+2
-1
integration-tests.hs
tests/integration-tests.hs
+3
-0
No files found.
haskell-pgmq.cabal
View file @
1728b3d5
...
@@ -66,6 +66,7 @@ library
...
@@ -66,6 +66,7 @@ library
-- Modules exported by the library.
-- Modules exported by the library.
exposed-modules: Database.PGMQ
exposed-modules: Database.PGMQ
, Database.PGMQ.Helpers
, Database.PGMQ.Schema
, Database.PGMQ.Schema
, Database.PGMQ.Simple
, Database.PGMQ.Simple
, Database.PGMQ.Types
, Database.PGMQ.Types
...
@@ -160,7 +161,8 @@ test-suite test-integration
...
@@ -160,7 +161,8 @@ test-suite test-integration
type: exitcode-stdio-1.0
type: exitcode-stdio-1.0
other-modules: Test.Integration.PGMQ.Simple
other-modules: Test.Integration.PGMQ.Helpers
, Test.Integration.PGMQ.Simple
, Test.Integration.Utils
, Test.Integration.Utils
build-depends: base ^>=4.17.2.0
build-depends: base ^>=4.17.2.0
...
...
src/Database/PGMQ.hs
View file @
1728b3d5
...
@@ -9,10 +9,12 @@ Portability : POSIX
...
@@ -9,10 +9,12 @@ Portability : POSIX
-}
-}
module
Database.PGMQ
module
Database.PGMQ
(
module
Database
.
PGMQ
.
Simple
(
module
Database
.
PGMQ
.
Helpers
,
module
Database
.
PGMQ
.
Simple
,
module
Database
.
PGMQ
.
Types
)
,
module
Database
.
PGMQ
.
Types
)
where
where
import
Database.PGMQ.Helpers
import
Database.PGMQ.Simple
import
Database.PGMQ.Simple
import
Database.PGMQ.Types
import
Database.PGMQ.Types
src/Database/PGMQ/Simple.hs
View file @
1728b3d5
...
@@ -249,7 +249,8 @@ sendMessage conn queue msg delay = do
...
@@ -249,7 +249,8 @@ sendMessage conn queue msg delay = do
[
PSQL
.
Only
msgId
]
<-
PSQL
.
query
conn
[
sql
|
SELECT pgmq.send(?, ?::jsonb, ?)
|]
(
queue
,
PSQL
.
Aeson
msg
,
delay
)
[
PSQL
.
Only
msgId
]
<-
PSQL
.
query
conn
[
sql
|
SELECT pgmq.send(?, ?::jsonb, ?)
|]
(
queue
,
PSQL
.
Aeson
msg
,
delay
)
return
msgId
return
msgId
-- | Sends a batch of messages
-- | Sends a batch of messages
-- https://tembo.io/pgmq/api/sql/functions/#send_batch
-- https://tembo.io/pgmq/api/sql/functions/#send_batch
sendMessages
::
(
SerializableMessage
a
)
sendMessages
::
(
SerializableMessage
a
)
...
...
tests/integration-tests.hs
View file @
1728b3d5
module
Main
where
module
Main
where
import
Test.Integration.PGMQ.Helpers
(
pgmqHelpersTests
)
import
Test.Integration.PGMQ.Simple
(
pgmqSimpleTests
)
import
Test.Integration.PGMQ.Simple
(
pgmqSimpleTests
)
import
Test.Tasty
import
Test.Tasty
import
Test.Tasty.Hspec
import
Test.Tasty.Hspec
...
@@ -8,10 +9,12 @@ import Test.Tasty.Hspec
...
@@ -8,10 +9,12 @@ import Test.Tasty.Hspec
main
::
IO
()
main
::
IO
()
main
=
do
main
=
do
pgmqHelpersSpec
<-
testSpec
"pgmqHelpersTests"
pgmqHelpersTests
pgmqSimpleSpec
<-
testSpec
"pgmqSimpleTests"
pgmqSimpleTests
pgmqSimpleSpec
<-
testSpec
"pgmqSimpleTests"
pgmqSimpleTests
defaultMain
$
testGroup
"integration tests"
defaultMain
$
testGroup
"integration tests"
[
[
pgmqSimpleSpec
pgmqSimpleSpec
,
pgmqHelpersSpec
]
]
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment