Documentation
¶
Overview ¶
Package watch re-introspects on DDL changes (dev mode). Preferred mechanism: a DDL event trigger NOTIFYing a channel that we LISTEN on. Fallback (no permission to create event triggers): poll the catalog hash.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Watcher ¶
type Watcher struct {
Pool *pgxpool.Pool
Schemas []string
Channel string
PollInterval time.Duration
OnChange func(cat *introspect.Catalog)
Log *slog.Logger
// TriggerName names the event trigger; the notify function is
// TriggerName + "_notify". Defaults to Channel + "_watch". Products
// sharing a database must use distinct names or the last one to start
// repoints the shared function at its own channel.
TriggerName string
}
Watcher triggers OnChange whenever the database schema drifts.
Click to show internal directories.
Click to hide internal directories.