final class TableLock
    implements Node
    uses Snapshot
Public API: explicitly declared with @visibility public.

One table LOCK TABLES locks: t [[AS] alias] lock_type.

The statement that holds it records the resolution of the table name as the relation fact of this node. A table locked under an alias is reached by later statements of the session only through that alias. Source: https://dev.mysql.com/doc/refman/8.4/en/lock-tables.html.

Holding a table, its alias and the lockdoctest
$lock = new \SqlSemantics\Platform\MySql\Statement\Server\Lock\TableLock(new \SqlSemantics\Platform\MySql\Model\Statement\Identifier\QualifiedName(new \SqlSemantics\Platform\MySql\Model\Statement\Identifier\Name('t')), new \SqlSemantics\Platform\MySql\Model\Statement\Identifier\Name('a'), \SqlSemantics\Platform\MySql\Statement\Server\Lock\LockMode::Write);
    [$lock->table->name->value, $lock->alias?->value, $lock->mode] // => ['t', 'a', \SqlSemantics\Platform\MySql\Statement\Server\Lock\LockMode::Write]

Properties§

public QualifiedName $table
public Name|null $alias
public LockMode $mode
public AliasMark $mark = AliasMark::As

Methods§

public function __construct(
    public QualifiedName $table,
    public Name|null $alias,
    public LockMode $mode,
    public AliasMark $mark = AliasMark::As,
)

Parameters

$tableQualifiedNameThe table name with its optional database
$aliasName|nullThe alias, when written
$modeLockModeThe lock
$markAliasMarkWhat is written before the alias
Calls 2
public function render(Output $out): void

Writes the table, the alias and the lock.

Parameters

$outOutput
Calls 7

Test cases 1§

Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.

Dedicated tests 1

Relations§

Instantiated in 1
Constant reads 1
Type declarations 1