notify

abstract fun notify(channel: String, payload: String? = null): DataResult<Unit>

Sends a notification to the given PostgreSQL channel via pg_notify.

Can be used both inside and outside of a transaction. If used inside a transaction, the notification is only delivered to listeners after the transaction commits.

Return

DataResult.Success on success, or DataResult.Failure on error.

Parameters

channel

Name of the channel to send the notification to.

payload

Optional payload string (max 8000 bytes). null sends no payload.