final class DatabaseReadOnly
    implements DatabaseOption
    uses Snapshot
Public API: explicitly declared with @visibility public.

READ ONLY [=] {DEFAULT | 0 | 1}: whether the database may be modified (ALTER DATABASE, MySQL 8.0.22 and later).

A number other than 0 makes the database read-only; 0 and DEFAULT make it writable. The equals sign is optional and not written. Source: https://dev.mysql.com/doc/refman/8.4/en/alter-database.html.

Making a database read-onlydoctest
$alter = (new \SqlSemantics\Platform\MySql\Semantics())->analyze('ALTER DATABASE d READ ONLY = 1');
    [$alter->toString(), $alter->statement->options[0]->readOnly()] // => ['ALTER DATABASE d READ ONLY 1', true]

Properties§

public Numeral|null $value

Methods§

public function __construct(public Numeral|null $value)

Parameters

$valueNumeral|nullThe number; null for DEFAULT
public function readOnly(): bool

Tells whether the option makes the database read-only: a number other than 0.

Returns

bool
Test cases 1
Calls 2
public function render(Output $out): void

Writes the option.

Parameters

$outOutput
Calls 2

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
Type checks 1
Type declarations 1