classPartitionClause
final class PartitionClause
implements Partitioning
uses Snapshot
@visibility public.PARTITION BY method [PARTITIONS n] [SUBPARTITION BY …] [(definitions)]: how a table is partitioned.
Mirrors PT_partition. Rule: MYSQL-PARTITIONING-001. The partitioning function and the partitioning columns are derived in the scope of the partitioned table, which the statement holding the clause provides: an expression gets the facts of its column references, a column name the completely known table does not have is the diagnostic UnknownColumn. The partition values are constants and see no column. An empty definition list means none is written. Terminates: one pass over the definitions. Source: https://dev.mysql.com/doc/refman/8.4/en/partitioning.html, https://dev.mysql.com/doc/refman/8.4/en/create-table.html#create-table-partitioning. Status: Implemented.
$clause = new \SqlSemantics\Platform\MySql\Statement\Partition\PartitionClause(new \SqlSemantics\Platform\MySql\Statement\Partition\Method\KeyMethod(false, null, []), new \SqlSemantics\Platform\MySql\Statement\Literal\Numeral('4'), null, []);
$clause->partitions?->text // => '4'Properties§
public list<PartitionDefinition> $definitionspublic PartitionMethod $methodpublic Numeral|null $partitionspublic Subpartitioning|null $subpartitioningMethods§
public function __construct(
public PartitionMethod $method,
public Numeral|null $partitions,
public Subpartitioning|null $subpartitioning,
list<PartitionDefinition> $definitions,
)Parameters
$method | PartitionMethod | The partitioning method |
$partitions | Numeral|null | The PARTITIONS count, when written |
$subpartitioning | Subpartitioning|null | The subpartitioning, when written |
$definitions | list<PartitionDefinition> | The partition definitions in order |
Calls 2
- static-call Check::listOf() line 55
- class-const PartitionDefinition::class() line 55
public function derivePartitioning(Derivation $derivation, Environment $scope): voidDerives the method and the subpartitioning in the scope of the table and the partition values as constants.
Parameters
$derivation | Derivation | |
$scope | Environment |
Called from 2
- method-call SqlSemantics\Platform\MySql\Statement\Alter\Partition\PartitionBy::deriveCommand() packages/sql-semantics-mysql/src/Statement/Alter/Partition/PartitionBy.php:41
- method-call SqlSemantics\Platform\MySql\Statement\Partition\PartitionEntry::deriveStatement() packages/sql-semantics-mysql/src/Statement/Partition/PartitionEntry.php:46
Calls 1
- method-call PartitionMethod::deriveMethod() line 63
public function render(Output $out): voidWrites the clause.
Parameters
$out | Output |
Calls 3
- method-call Output::keyword() line 75
- method-call Output::node() line 79
- method-call Output::symbol() line 81
Test cases 3§
Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.
Dedicated tests 1
PartitionClauseTestcalls
Other tests reaching this symbol 2
Relations§
Instantiated in 1
Method calls 2
- method-call SqlSemantics\Platform\MySql\Statement\Alter\Partition\PartitionBy::deriveCommand() packages/sql-semantics-mysql/src/Statement/Alter/Partition/PartitionBy.php:41
- method-call SqlSemantics\Platform\MySql\Statement\Partition\PartitionEntry::deriveStatement() packages/sql-semantics-mysql/src/Statement/Partition/PartitionEntry.php:46
Type declarations 5
- type SqlSemantics\Platform\MySql\Lowering\TableChange\Partition\PartitionRule packages/sql-semantics-mysql/src/Lowering/TableChange/Partition/PartitionRule.php:106
- type SqlSemantics\Platform\MySql\Lowering\TableChange\Partition\PartitionRule packages/sql-semantics-mysql/src/Lowering/TableChange/Partition/PartitionRule.php:125
- type SqlSemantics\Platform\MySql\Lowering\TableChange\Partition\PartitionRule packages/sql-semantics-mysql/src/Lowering/TableChange/Partition/PartitionRule.php:152
- type SqlSemantics\Platform\MySql\Statement\Alter\Partition\PartitionBy packages/sql-semantics-mysql/src/Statement/Alter/Partition/PartitionBy.php:32
- type SqlSemantics\Platform\MySql\Statement\Partition\PartitionEntry packages/sql-semantics-mysql/src/Statement/Partition/PartitionEntry.php:36