initial commit

This commit is contained in:
Bartal Laearsson
2026-08-11 20:42:44 +01:00
commit d9a0cd749e
27 changed files with 2868 additions and 0 deletions
+20
View File
@@ -0,0 +1,20 @@
#!/bin/sh
set -eu
STREAM="${STREAM:-DebeziumStream}"
COUNT="${COUNT:-20}"
CONSUMER="viewer-$(date +%s)"
echo "Stream subjects:"
nats --server "$NATS_URL" stream subjects "$STREAM"
echo
echo "Change events:"
nats --server "$NATS_URL" consumer add "$STREAM" "$CONSUMER" --ephemeral --pull --defaults >/dev/null
if command -v jq >/dev/null 2>&1; then
nats --server "$NATS_URL" consumer next --raw --count "$COUNT" "$STREAM" "$CONSUMER" \
| jq -c '{op, table: .source.table, before, after}'
else
nats --server "$NATS_URL" consumer next --raw --count "$COUNT" "$STREAM" "$CONSUMER"
fi