classPartitionElement
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.
$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 ColumnKey|ExpressionKey $keypublic DottedName|null $collation = nullpublic DottedName|null $operatorClass = nullMethods§
public function __construct(
public ColumnKey|ExpressionKey $key,
public DottedName|null $collation = null,
public DottedName|null $operatorClass = null,
)Parameters
$key | ColumnKey|ExpressionKey | The column or expression |
$collation | DottedName|null | The collation |
$operatorClass | DottedName|null | The operator class |
public function deriveClause(Derivation $derivation, Environment $environment): voidDerives the key.
Parameters
$derivation | Derivation | |
$environment | Environment |
Calls 1
- method-call Derivation::scalar() line 46
public function render(Output $out): voidWrites the key, the collation and the operator class.
Parameters
$out | Output |
Calls 2
- method-call Output::node() line 54
- method-call Output::keyword() line 56
Test cases 1§
Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.
Dedicated tests 1
PartitionElementTestcalls