classNotify
final class Notify
implements Statement
uses Snapshot
Public API: explicitly declared with
@visibility public.NOTIFY channel [, payload]: a request to send a notification to the listeners of a channel.
Rule: PG-NOTIFY-001. Mirrors PostgreSQL's NotifyStmt (conditionname, payload). The statement also occurs as an action of a rule. Facts: none; a channel is not part of a declaration context. Diagnostic: a payload of 8000 bytes or more, the limit of the default configuration (a block size of 8192 bytes), counted in UTF-8. Source: https://www.postgresql.org/docs/17/sql-notify.html. Status: Implemented.
$operation = (new \SqlSemantics\Platform\PostgreSql\Semantics())->analyze("NOTIFY jobs, 'ready'");
[$operation->statement->channel->value, $operation->statement->payload->value] // => ['jobs', 'ready']Properties§
public Name $channelpublic StringConstant|null $payload = nullMethods§
public function __construct(public Name $channel, public StringConstant|null $payload = null)Parameters
$channel | Name | The channel name |
$payload | StringConstant|null | The payload string, when written |
public function deriveStatement(Derivation $derivation): voidReports a payload longer than the server takes.
Parameters
$derivation | Derivation |
Calls 5
- function-call
strlenline 54 - class-const Notify::PAYLOAD_LIMIT() line 54
- method-call Derivation::report() line 55
- new UtilityProblem line 55
- class-const UtilityProblemKind::PayloadTooLong() line 55
public function render(Output $out): voidWrites the request.
Parameters
$out | Output |
Calls 3
- method-call Output::keyword() line 64
- class-const NameUse::Column() line 64
- method-call Output::symbol() line 66
Private surface 1§
Implementation details, listed for orientation only.
private const PAYLOAD_LIMIT = 8000Test cases 2§
Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.
Dedicated tests 1
NotifyTestcalls