LiveSync.Watch protocol (live_sync v0.1.2)

Protocol for defining which Ecto schemas to watch for changes.

Two options are supported:

  • subscription_key (required): The field on the schema that is used to filter messages that a LiveView session is subscribed to
  • table (optional): The table to watch, defaults to the schema's table name, if using a view you need to specify the table name

Example:

@derive {LiveSync.Watch,
        [
          subscription_key: :organization_id,
          table: "table"
        ]}

Summary

Types

t()

All the types that implement this protocol.

Types

t()

@type t() :: term()

All the types that implement this protocol.

Functions

info(struct)

subscription_key(struct)