final class Table
    uses Snapshot
Public API: explicitly declared with @visibility public.

A relation declaration supplied to an analysis context: a table or a view with its columns.

The object is the identity of the declaration. Two equal-looking tables are two declarations, and a context that holds both keeps the conflict.

Reading the declaration a CREATE TABLE providesdoctest
$semantics = new \SqlSemantics\Platform\Sqlite\Semantics();
    $table = $semantics->analyze('CREATE TABLE users (id INTEGER, name TEXT)')->declarations()[0];
    [$table->name->name->value, count($table->columns)] // => ['users', 2]

Properties§

public list<Column> $columns
public list<ImplicitColumn> $implicit
public LanguageProfile $profile
public bool $complete = true
public RelationKind $kind = RelationKind::BaseTable

Methods§

public function __construct(
    public QualifiedName $name,
    public LanguageProfile $profile,
    list<Column> $columns,
    list<ImplicitColumn> $implicit = [],
    public bool $complete = true,
    public RelationKind $kind = RelationKind::BaseTable,
)

Parameters

$nameQualifiedNameThe declared name
$profileLanguageProfileThe language profile the declaration was read under
$columnslist<Column>The declared columns in declaration order
$implicitlist<ImplicitColumn>The columns found by name without being declared
$completeboolWhether the column list is the complete member list of the relation
$kindRelationKindWhether the relation is a base table, a view, or another kind of relation
Calls 4
public function matchingColumns(string $name, Comparison $comparison): list<Column>

Finds the declared columns a name denotes, falling back to the implicit columns.

More than one result means the declaration itself repeats the name.

Parameters

$namestring
$comparisonComparison

Returns

list<Column>
Test cases 3
Calls 1

Test cases 19§

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

Dedicated tests 5
Other tests reaching this symbol 14

Relations§

Instantiated in 4
Constant reads 4
Type declarations 9