classDatabaseReadOnly
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.
$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 $valueMethods§
public function __construct(public Numeral|null $value)Parameters
$value | Numeral|null | The number; null for DEFAULT |
public function readOnly(): boolTells whether the option makes the database read-only: a number other than 0.
Returns
boolTest cases 1
public function render(Output $out): voidWrites the option.
Parameters
$out | Output |
Calls 2
- method-call Output::keyword() line 47
- method-call Output::node() line 51
Test cases 1§
Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.