final class SchemaReader
Restricted visibility: declared "@visibility SqlSemantics". Code outside that scope must not name this declaration.

Builds a schema snapshot from CREATE TABLE syntax nodes.

Properties§

public Identifiers $identifiers
public string $defaultSchema

Methods§

public function __construct(
    public Identifiers $identifiers,
    public string $defaultSchema,
    ?ValueReader $values = null,
)

Binds the dependencies used for semantic binding.

Parameters

$identifiersIdentifiers
$defaultSchemastring
$values?ValueReader
Calls 2
public function read(list<Node> $trees): list<TableDefinition>
public function table(Node $create): TableDefinition

Reads one table and promotes the nullability of primary key columns.

Parameters

$createNode
Called from 1
Calls 16
public function validate(Node $source, Node $header): void

Rejects declarations whose column state requires evaluating another relation.

Parameters

$sourceNode
$headerNode
Called from 1
public function columnNodes(Node $create): list<array{Node, list<Node>}>
public function primaryKeys(
    list<ColumnDefinition> $columns,
    list<TableConstraint> $constraints,
    Node $source,
): list<ColumnDefinition>

Parameters

$columnslist<ColumnDefinition>
$constraintslist<TableConstraint>
$sourceNode

Returns

Called from 1
Calls 8
public function primaryNotNull(
    ColumnDefinition $column,
    list<string> $primary,
    list<TableConstraint> $constraints,
): bool

Parameters

$columnColumnDefinition
$primarylist<string>
$constraintslist<TableConstraint>

Returns

bool
Called from 1

Private surface 1§

Implementation details, listed for orientation only.

private ValueReader $values

Test cases 60§

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

Dedicated tests 1
Other tests reaching this symbol 59

Relations§

Instantiated in 1
Method calls 1