classColumnKey
final class ColumnKey
implements Scalar
uses Snapshot
Public API: explicitly declared with
@visibility public.A column written by name as the key of an index, a partition key or extended statistics.
Mirrors the name of PostgreSQL's IndexElem, PartitionElem and StatsElem. The name is resolved as a column of the indexed relation, which is the only relation visible there. Source: https://www.postgresql.org/docs/17/sql-createindex.html.
$semantics = new \SqlSemantics\Platform\PostgreSql\Semantics();
$table = $semantics->analyze('CREATE TABLE t (a int, b text)');
$index = $semantics->analyze('CREATE INDEX i ON t (b)', $table->declarations());
$index->facts->scalar($index->statement->elements[0]->key)->resolution->slot->column === $table->declarations()[0]->columns[1] // => trueProperties§
public Name $columnMethods§
public function deriveScalar(Derivation $derivation, Environment $environment): ScalarFactResolves the name as a column.
Parameters
$derivation | Derivation | |
$environment | Environment |
Returns
Calls 2
- method-call ColumnFacts::derive() line 47
- new ColumnFacts line 47
public function render(Output $out): voidTest cases 2§
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 1
Relations§
Instantiated in 3
- new SqlSemantics\Platform\PostgreSql\Lowering\Table\IndexRule::element() packages/sql-semantics-postgres/src/Lowering/Table/IndexRule.php:185
- new SqlSemantics\Platform\PostgreSql\Lowering\Table\MaintenanceRule::statistics() packages/sql-semantics-postgres/src/Lowering/Table/MaintenanceRule.php:80
- new SqlSemantics\Platform\PostgreSql\Lowering\Table\PartitionRule::element() packages/sql-semantics-postgres/src/Lowering/Table/PartitionRule.php:81
Type checks 1
Type declarations 3
- type SqlSemantics\Platform\PostgreSql\Lowering\Table\IndexRule packages/sql-semantics-postgres/src/Lowering/Table/IndexRule.php:199
- type SqlSemantics\Platform\PostgreSql\Statement\Table\Index\IndexElement packages/sql-semantics-postgres/src/Statement/Table/Index/IndexElement.php:51
- type SqlSemantics\Platform\PostgreSql\Statement\Table\Partition\PartitionElement packages/sql-semantics-postgres/src/Statement/Table/Partition/PartitionElement.php:37