OWN_PREFIX
OWN_PREFIX = 'strata_'
Table prefix this module owns, never captured.
Decides whether a given change is captured at all.
Read on every mutation, so every answer is resolved from configuration once per request and held. A scope check that hit the config system per entity save would cost more than the capture it guards.
Strata's own tables are never captured. Recording the journal in the journal, or the frame index in a frame, is an unbounded feedback loop rather than a backup.
tapsStatements() : bool
Whether the raw SQL tap runs at all.
Separate from whether the table realm is captured, and deliberately so: the tap is the only driver-agnostic way to see a write nothing else instrumented, and it is also the only capture that adds cost to every statement a site runs rather than to every mutation. Measured at under 10 us per mutation, but a site that has calibrated and does not want it gets a switch that stops the events being enabled at all rather than one that filters afterwards.
TRUE when statement events should be enabled on the connection.
coversTarget(string $target) : bool
Whether a connection target is captured.
A replica target sees only reads by definition, so a write arriving on one is either a misconfiguration or a deliberate write to a secondary that the primary will not have. Neither belongs in the primary's history.
| string | $target | The connection target, such as "default" or "replica". |
TRUE when writes on this target are captured.
settings() : array<string,mixed>
The settings, resolved once.
??= assigns after its right-hand side has run, so during a cold read the memo is still NULL.
A cold read of strata.settings misses cache_config and writes it back, that write is a
MERGE, and MERGE is a write keyword the statement tap acts on - which asks this object what it
covers, from inside the read that has not finished. The flag ends that walk rather than
recursing. What makes it unreachable today is that StatementCaptureSubscriber::enable()
resolves the scope before it enables the events, and that invariant lives in another class.
The raw settings array, or an empty one while a resolution is already in flight, which reads as "nothing is captured" and is the safe answer for a statement Strata itself caused.