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().
Methods
Section titled “Methods”on(event, listener): void;Defined in: src/storage/watch.ts:91
Register the notification listener.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
event |
"notification" |
listener |
(msg) => void |
Returns
Section titled “Returns”void
query()
Section titled “query()”query(sql): Promise<unknown>;Defined in: src/storage/watch.ts:89
Run a statement (LISTEN/UNLISTEN).
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
sql |
string |
Returns
Section titled “Returns”Promise<unknown>
removeListener()
Section titled “removeListener()”removeListener(event, listener): void;Defined in: src/storage/watch.ts:93
Remove the notification listener.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
event |
"notification" |
listener |
(msg) => void |
Returns
Section titled “Returns”void