final class PartitionElement
    implements Clause
    uses Snapshot
Public API: explicitly declared with @visibility public.

One column or expression of a partition key, with its collation and operator class.

Mirrors PostgreSQL's PartitionElem. The key is derived where the columns of the table are visible. Source: https://www.postgresql.org/docs/17/sql-createtable.html.

Reading a partition keydoctest
$create = (new \SqlSemantics\Platform\PostgreSql\Semantics())->analyze('CREATE TABLE t (a text) PARTITION BY LIST (a COLLATE "C" text_ops)');
    $create->statement->partitioning->elements[0]->operatorClass->last()->value // => 'text_ops'

Properties§

public DottedName|null $collation = null
public DottedName|null $operatorClass = null

Methods§

public function __construct(
    public ColumnKey|ExpressionKey $key,
    public DottedName|null $collation = null,
    public DottedName|null $operatorClass = null,
)

Parameters

$keyColumnKey|ExpressionKeyThe column or expression
$collationDottedName|nullThe collation
$operatorClassDottedName|nullThe operator class
public function deriveClause(Derivation $derivation, Environment $environment): void

Derives the key.

Parameters

$derivationDerivation
$environmentEnvironment
Calls 1
public function render(Output $out): void

Writes the key, the collation and the operator class.

Parameters

$outOutput
Calls 2

Test cases 1§

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

Dedicated tests 1

Relations§

Instantiated in 1
Constant reads 1
Type declarations 1