final class Schema
Public API: explicitly declared with @visibility public.

Reads the table state needed to analyze statements against known declarations.

Schema describes state; Semantics describes SQL operations. Statements whose resulting columns require query evaluation remain statement models.

Reading state for statement bindingdoctest
$schema = new \SqlSemantics\Facade\Schema(\SqlSemantics\Platform\Sqlite\Dialect::Sqlite);
    $schema->analyze('CREATE TABLE t (id INTEGER)')->tables[0]->name // => 't'

Methods§

public function __construct(
    Dialect $dialect,
    ?string $defaultSchema = null,
    ?string $grammarVersion = null,
)

Selects the state declaration language, release and unqualified namespace.

Parameters

$dialectDialect
$defaultSchema?string
$grammarVersion?string
Calls 1
public function analyze(string ...$sql): Schema

Reads table declarations and DROP TABLE resets into an independent state.

Parameters

$sqlstring

Returns

Throws

SemanticException When catalog facts conflict or cannot be resolved
AnalysisException When declarations are outside the selected language
Test cases 34
Calls 1

Private surface 1§

Implementation details, listed for orientation only.

private SchemaAnalyzer $analyzer

Test cases 35§

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

Dedicated tests 8
Other tests reaching this symbol 27