final class RewritePlan

Represents the rewrite outcome for a single SQL statement.

Methods§

public function __construct(
    string $sql,
    QueryKind $kind,
    ShadowMutation|null $mutation = null,
    ReturningProjection|null $returningProjection = null,
    AffectedRowsMode $affectedRowsMode = AffectedRowsMode::Changed,
)
public function mutation(): ?ShadowMutation

Get the mutation for write simulation, if any.

Test cases 2
public function requireMutation(): ShadowMutation

Answers the mutation a simulated write must carry.

A plan whose kind says the write was simulated and that carries no mutation describes nothing the shadow could be told, so the statement is refused rather than read back as though it had been simulated.

Returns

ShadowMutation The mutation

Throws

RuntimeException When the plan carries none
Test cases 2
Called from 2
Calls 1

Private surface 5§

Implementation details, listed for orientation only.

private string $sql
private QueryKind $kind
private ShadowMutation|null $mutation
private ?ReturningProjection $returningProjection
private AffectedRowsMode $affectedRowsMode

Test cases 32§

Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.

Dedicated tests 7
Other tests reaching this symbol 25

Relations§

Instantiated in 3
Method calls 11
Type declarations 10