database-pg
litmus-pgnats

litmus-pgnats is a PostgreSQL extension that integrates PostgreSQL with NATS messaging.

v1.0.0

How it works

litmus-pgnats — PostgreSQL extension for NATS messaging

litmus-pgnats is a PostgreSQL extension (written in Rust via pgrx) that integrates PostgreSQL with NATS messaging. It exposes SQL functions for publishing, subscribing, request/reply, JetStream, Key-Value store, Object Store, and responder operations.

Originally based on luxms/pgnats. The codebase has been substantially reworked: migrated to standard upstream pgrx, extended authentication support, per-call JetStream domain routing, and persistent responder background workers.

Features

  • Publish to core NATS subjects from SQL (binary, text, JSON, JSONB)
  • Subscribe NATS subjects to PostgreSQL callback functions (background workers)
  • JetStream stream publish with optional per-call domain override
  • Key-Value storage operations from SQL
  • Object Store operations from SQL
  • Request/reply from SQL
  • Persistent responder background workers (register a PG function as a NATS request handler)
  • Works on Postgres clusters (Patroni role-change notifications)
image (28)