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

One option of CREATE DATABASE or ALTER DATABASE: a name and a value.

Mirrors the DefElem of createdb_opt_item. The name is either one of the keyword spellings or an identifier; the value is a number, a word, a string, TRUE, FALSE, ON or DEFAULT. The optional = between them is not kept. Source: https://www.postgresql.org/docs/17/sql-createdatabase.html.

Reading an option written as an identifierdoctest
$operation = (new \SqlSemantics\Platform\PostgreSql\Semantics())->analyze('CREATE DATABASE d is_template = true');
    $operation->statement->options[0]->option() // => 'is_template'

Properties§

Methods§

public function __construct(
    public DatabaseOptionKeyword|Name $name,
    public OptionArgument $value,
)

Parameters

$nameDatabaseOptionKeyword|NameThe keyword spelling or the identifier that names the option
$valueOptionArgumentThe value
public function option(): string

Answers the option name the server receives.

Returns

string
public function deriveClause(Derivation $derivation, Environment $environment): void

Derives the value.

Parameters

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

Writes the name, an equals sign and the value.

Parameters

$outOutput
Calls 5

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
Constant reads 2
Type declarations 1