Module postgres

Source
Expand description

PostgreSQL Table Listener

This module provides PostgresTableListener, which listens for changes in specified database tables. It uses PostgreSQL triggers and LISTEN/NOTIFY to capture and relay events asynchronously.

§Features

  • Monitors specified tables for INSERT, UPDATE, and DELETE operations.
  • Captures changes at the column level.
  • Uses PostgreSQL triggers and functions for efficient event detection.
  • Sends notifications through async channels.
  • Provides a structured API to start and stop listeners.

§Dependencies

  • sqlx for database interaction
  • tokio for async execution
  • serde and serde_json for JSON serialization
  • tracing for logging

Structs§

PgNotify
PostgresTableListener