Getting started
Speculare PGCDC is used to stream change from the Postgres database over WebSocket to active clients.
Setup
As of now Speculare PGCDC does not provide easy setup solution such as a one-line installer (but it's planned). The current recommanded way to install Speculare PGCDC is to build it from source. But don't be afraid, it's easy and straightforwards.
Configuration files
The server binary depends on a pgcdc.config
file whose path will be passed as arguments to the binary.
You can create your pgcdc.config
from the pgcdc.example.config
given in the source code.
PGCDC will get a list of available tables at startup time. In case of update of the database you might need to restart PGCDC to refetch new tables.
Example of usage
Use this base request:
Will get change_type
event from table
where col is equals to val
. The change_table
and table
parameters are mandatory, if you're missing them you'll get a 400 error.
change_table
: can be either of those: *, insert, update, deletetable
: must be a real table from your databasecol.eq.val
: is optional but col is the column name and val is the expected value (String)
Install as a service
Here is a sample speculare-pgcdc.service
for systemd:
The above service will start after postgres, this is important. The pgcdc cannot start before postgresql.
Last updated