final class Script
    implements Statement
    uses Snapshot
Public API: explicitly declared with @visibility public.

Several statements written as one input, each a request of its own.

Every statement is derived against the same context. An earlier statement is not executed for a later one: a CREATE in the script declares nothing for the statements after it. The declarations and diagnostics of every member are those of the script; the rows of a member are not, since a script has no single row set.

Collecting statements from a scriptdoctest
$semantics = new \SqlSemantics\Platform\MySql\Semantics();
    $operations = $semantics->analyzeAll('SELECT 1; SELECT 2');
    $script = new \SqlSemantics\Platform\MySql\Model\Statement\Script([$operations[0]->statement, $operations[1]->statement]);
    count($script->statements) // => 2

Properties§

public list<Statement> $statements

Methods§

public function __construct(list<Statement> $statements)

Parameters

$statementslist<Statement>The statements in input order; not exactly one
Calls 4
public function deriveStatement(Derivation $derivation): void

Derives each statement against the same unchanged context; the script itself returns no rows.

Parameters

$derivationDerivation
Calls 1
public function render(Output $out): void

Writes the statements separated by terminators.

Parameters

$outOutput
Calls 2

Relations§

Instantiated in 1