Topic constants and subscribe/broadcast helpers for the DB module,
backed by PhoenixKit.PubSub.Manager (the shared in-process PubSub
server).
The Postgres LISTEN/NOTIFY channel itself
(pubsub_changes)
is internal to PhoenixKitDb.Listener — these helpers wrap the
per-LiveView fan-out that the Listener performs after parsing each
notification.
Topics
topic_all/0— every mutation, regardless of table. Used by the Index page (table-list refresh) and the Activity page (live feed).topic_table/2— mutations for one specificschema.table. Used by the Show page so a busy unrelated table doesn't refresh the row preview.
Events
Messages are {:table_changed, schema, table, operation, row_id}
tuples. operation is "INSERT" / "UPDATE" / "DELETE" (or
"UNKNOWN" for a malformed payload). row_id may be nil when the
underlying row has neither a uuid nor an id column.
Summary
Functions
Broadcasts a :table_changed message on a topic.
Subscribes the calling process to the given topic.
Topic that fans out every mutation across every watched table.
Topic scoped to a single schema.table pair.
Unsubscribes the calling process from the given topic.
Types
@type topic() :: String.t()
PubSub topic name.
Functions
Broadcasts a :table_changed message on a topic.
Subscribes the calling process to the given topic.
@spec topic_all() :: topic()
Topic that fans out every mutation across every watched table.
Topic scoped to a single schema.table pair.
Unsubscribes the calling process from the given topic.