final class LockOption
    implements AlterOption, AlterModifier
    uses Snapshot
Public API: explicitly declared with @visibility public.

LOCK [=] DEFAULT | name: how much concurrent access a table change must allow.

The grammar reads the lock level as an identifier; the server accepts NONE, SHARED and EXCLUSIVE, and the word DEFAULT spelled as an identifier in 5.6 and 5.7, compared without regard to case. Any other name is the diagnostic UnknownAlterChoice (MYSQL-ALTER-CHOICES-001). The name is kept as written; the keyword DEFAULT is the absent name. Source: https://dev.mysql.com/doc/refman/8.4/en/alter-table.html#alter-table-performance.

Requesting a change that blocks no reader or writerdoctest
(new \SqlSemantics\Platform\MySql\Statement\Alter\Modifier\LockOption(new \SqlSemantics\Platform\MySql\Model\Statement\Identifier\Name('NONE')))->lock?->value // => 'NONE'

Properties§

public Name|null $lock

Methods§

public function __construct(public Name|null $lock)

Parameters

$lockName|nullThe lock level, or null for the keyword DEFAULT
public function deriveOption(Derivation $derivation): void

Reports a lock level the server of the release does not know.

Parameters

$derivationDerivation
Called from 1
Calls 2
public function deriveCommand(Derivation $derivation, Environment $scope): void

Derives the option as an action of ALTER TABLE.

Parameters

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

Writes the option.

Parameters

$outOutput
Calls 3

Test cases 2§

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 1

Relations§

Instantiated in 1
Type declarations 1