classColumnsMethod
final class ColumnsMethod
implements PartitionMethod
uses Snapshot
Public API: explicitly declared with
@visibility public.RANGE COLUMNS (columns) or LIST COLUMNS (columns): partitioning by a tuple of column values.
Mirrors PT_part_type_def_range_columns and PT_part_type_def_list_columns. The grammar of 5.6 and 5.7 also accepts an empty list, which the server rejects; it is kept. A column name the completely known table does not have is a diagnostic. Source: https://dev.mysql.com/doc/refman/8.4/en/partitioning-columns.html.
$method = new \SqlSemantics\Platform\MySql\Statement\Partition\Method\ColumnsMethod(\SqlSemantics\Platform\MySql\Statement\Partition\Method\PartitionKind::List, [new \SqlSemantics\Platform\MySql\Model\Statement\Identifier\Name('region')]);
[$method->kind->value, $method->columns[0]->value] // => ['LIST', 'region']Properties§
public list<Name> $columnspublic PartitionKind $kindMethods§
public function __construct(public PartitionKind $kind, list<Name> $columns)Parameters
$kind | PartitionKind | RANGE or LIST |
$columns | list<Name> | The partitioning columns in order |
Calls 2
- static-call Check::listOf() line 44
- class-const Name::class() line 44
public function deriveMethod(Derivation $derivation, Environment $scope): voidReports the column names the completely known table does not have.
Parameters
$derivation | Derivation | |
$scope | Environment |
Calls 2
- method-call ColumnNames::check() line 52
- new ColumnNames line 52
public function render(Output $out): voidWrites the method.
Parameters
$out | Output |
Calls 3
- method-call Output::keyword() line 60
- method-call ColumnNames::write() line 61
- new ColumnNames line 61
Test cases 1§
Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.
Dedicated tests 1
ColumnsMethodTestcalls
Relations§
Instantiated in 2
- new SqlSemantics\Platform\MySql\Lowering\TableChange\Partition\PartitionRule::method() packages/sql-semantics-mysql/src/Lowering/TableChange/Partition/PartitionRule.php:179
- new SqlSemantics\Platform\MySql\Lowering\TableChange\Partition\PartitionRule::method() packages/sql-semantics-mysql/src/Lowering/TableChange/Partition/PartitionRule.php:180