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

A closed schema snapshot. Missing declarations are errors, not invented tables.

Accept this semantic value in a database-independent consumerdoctest
$consume = static fn (\SqlSemantics\Core\Schema $value): string => $value::class;
    $consume instanceof \Closure // => true

Properties§

public Dialect $dialect
public list<TableDefinition> $tables
public string $defaultSchema
public string $grammarVersion

Methods§

public function __construct(
    public Dialect $dialect,
    public list<TableDefinition> $tables,
    public string $defaultSchema,
    public string $grammarVersion,
)

Parameters

$dialectDialectLanguage used to interpret the declarations
$tableslist<TableDefinition>Declarations visible to semantic binding
$defaultSchemastringSchema used for unqualified table declarations and references
$grammarVersionstringResolved sql-parser grammar release shared by DDL and SELECT

Throws

InvalidArgumentException When supplied state violates its invariants
Calls 5
public function withTables(TableDefinition ...$tables): self

Replaces state tables while preserving this snapshot and its language context.

Parameters

Returns

self

Throws

InvalidArgumentException When the replacement state violates its invariants
Calls 2

Test cases 60§

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

Dedicated tests 2
Other tests reaching this symbol 58

Relations§

Instantiated in 1
Type declarations 6