https://github.com/d3f0/notify
A very simple example of message publishing
https://github.com/d3f0/notify
Last synced: 11 months ago
JSON representation
A very simple example of message publishing
- Host: GitHub
- URL: https://github.com/d3f0/notify
- Owner: D3f0
- License: mit
- Created: 2023-03-27T14:03:25.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2023-03-27T14:08:37.000Z (about 3 years ago)
- Last Synced: 2025-05-15T08:45:13.496Z (about 1 year ago)
- Language: Python
- Size: 1.5 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Postgres Notifications Example
Inspiration for this project comes from this
[blog post](https://coussej.github.io/2015/09/15/Listening-to-generic-JSON-notifications-from-PostgreSQL-in-Go/)
by Jeroen Coussement.
## How to run
```bash
docker-compose up --build
```
### Important pieces
* `services/postgres/docker-entrypoint-initdb.d/*.sql`
Defines the table, function and sets the trigger. The
channel name is a geric `events`
* `services/notifier/src/notifier/main.py`
Simple script that connects to Postgres, adds an event listener
whose callback is function printing to stdout.
* adminer
This is a generic adminer image running in `:3000`. It should
be reachable at [http://localhost:3000](http://localhost:3000/?pgsql=postgres&username=postgres&db=example&ns=public&select=products)
## In action
