packages feed

haskell-pgmq-0.1.0.0: README.md

# Haskell PGMQ

This is a Haskell interface to Tembo's
[pgmq](https://github.com/tembo-io/pgmq) PostgreSQL extension.

The API design is based on [Elixir PGMQ](https://hexdocs.pm/pgmq/Pgmq.html) bindings.

## Running test cases

There is a binary located at [./bin/simple-test/Main.hs](./bin/simple-test/Main.hs), which contains all test cases
for the basic module `Database.PGMQ.Simple`.

First, choose which container image to use:
```shell
export PGMQ_CONTAINER=quay.io/tembo/pg16-pgmq:latest
```
However, with the above container, some tests might fail because certain functions
throw errors when a table is not present (e.g. `pgmq.drop_queue`).

Some fixes are available in our custom repository:
https://github.com/garganscript/pgmq
and you can use:
```shell
export PGMQ_CONTAINER=cgenie/pgmq:16-1.3.3.1
```

To run the tests, first start a PGMQ container:
```shell
  podman run --rm --name pgmq -e POSTGRES_PASSWORD=postgres -p 5432:5432 $PGMQ_CONTAINER
```
or with Docker:
```shell
  docker run --rm --name pgmq -e POSTGRES_PASSWORD=postgres -p 5432:5432 $PGMQ_CONTAINER
```
Then, execute the tests:
```shell
  cabal v2-test
```
The tests should print debug information and complete without errors.