Skip to content

PgNotificationClient

Defined in: src/storage/watch.ts:87

A dedicated notification client for pgListenNotify, satisfied by a pg Client. A Pool won’t do (it rotates connections); use a Client you connect().

on(event, listener): void;

Defined in: src/storage/watch.ts:91

Register the notification listener.

Parameter Type
event "notification"
listener (msg) => void

void


query(sql): Promise<unknown>;

Defined in: src/storage/watch.ts:89

Run a statement (LISTEN/UNLISTEN).

Parameter Type
sql string

Promise<unknown>


removeListener(event, listener): void;

Defined in: src/storage/watch.ts:93

Remove the notification listener.

Parameter Type
event "notification"
listener (msg) => void

void