final class ExpressionPart
    implements KeyPart
    uses Snapshot
Public API: explicitly declared with @visibility public.

A functional key part: an expression in parentheses that the index stores (MySQL 8.0.13 and later).

The expression sees the columns of the indexed table. Source: https://dev.mysql.com/doc/refman/8.4/en/create-index.html#create-index-functional-key-parts.

Reading a functional key partdoctest
$create = (new \SqlSemantics\Platform\MySql\Semantics())->analyze('CREATE TABLE t (a INT, KEY ((a + 1)))');
    $create->statement->elements[1]->parts[0] instanceof \SqlSemantics\Platform\MySql\Statement\Table\Key\ExpressionPart // => true

Properties§

public Scalar $expression
public Direction|null $direction = null

Methods§

public function __construct(public Scalar $expression, public Direction|null $direction = null)

Parameters

$expressionScalarThe indexed expression
$directionDirection|nullThe sort direction, when written
public function deriveKeyPart(Derivation $derivation, Environment $scope): void

Derives the expression at the position of the indexed table.

Parameters

$derivationDerivation
$scopeEnvironment
Test cases 1
Calls 1
public function render(Output $out): void

Writes the parenthesized expression and the direction.

Parameters

$outOutput
Calls 2

Test cases 4§

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 3

Relations§

Instantiated in 1