final class MySqlRewriter
    implements SqlRewriter, RewriteStateCommitter

MySQL rewrite implementation for ZTD.

Orchestrates parsing, classification, transformation, and mutation resolution.

Methods§

public function transactionStatement(string $sql): ?TransactionStatement

Transaction Statement for the supplied MySQL input.

Parameters

$sqlstring
Test cases 1
Calls 2
public function __construct(
    MySqlQueryGuard $guard,
    ShadowStore $shadowStore,
    TableDefinitionRegistry $registry,
    MySqlTransformer $transformer,
    MySqlMutationResolver $mutationResolver,
    MySqlParser $parser,
    ?ViewDefinitionSet $views = null,
)

Configure the dependencies used by this operation.

Parameters

Calls 2
public function rewrite(string $sql): RewritePlan

{@inheritDoc}

Parameters

$sqlstring

Throws

UnsupportedSqlException When SQL is empty, unparseable, or multi-statement.
UnknownSchemaException When SQL references unknown tables/columns.
Test cases 147
Called from 2
Calls 12
public function splitStatements(string $sql): array
public function commitRewriteState(): void

Commit Rewrite State for the supplied MySQL input.

Test cases 1
Calls 1
public function emptyResultSelect(): string

Empty Result Select for the supplied MySQL input.

Returns

string
Test cases 1

Private surface 8§

Implementation details, listed for orientation only.

private MySqlQueryGuard $guard
private ShadowStore $shadowStore
private TableDefinitionRegistry $registry
private MySqlTransformer $transformer
private MySqlMutationResolver $mutationResolver
private MySqlParser $parser
private MySqlCteShadowComposer $cteComposer
private ViewDefinitionSet $views

Test cases 157§

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

Dedicated tests 149
Other tests reaching this symbol 8

Relations§

Instantiated in 1