final class AlterDatabase
    implements Statement
    uses Snapshot
Public API: explicitly declared with @visibility public.

A request to change options of a database.

Rule: PG-ALTERDB-001. Mirrors AlterDatabaseStmt with an option list. The optional WITH is not kept. ALTER DATABASE recognizes fewer options than CREATE DATABASE, and TABLESPACE only alone (PG-CATALOG-OPTION-001). Source: https://www.postgresql.org/docs/17/sql-alterdatabase.html. Status: Implemented.

Changing the connection limitdoctest
$operation = (new \SqlSemantics\Platform\PostgreSql\Semantics())->analyze('ALTER DATABASE d CONNECTION LIMIT 10');
    $operation->toString() // => 'ALTER DATABASE d WITH CONNECTION LIMIT = 10'

Properties§

public list<DatabaseOption> $options
public Name $name

Methods§

public function __construct(public Name $name, list<DatabaseOption> $options = [])

Parameters

$nameNameThe database name
$optionslist<DatabaseOption>The options in the order written
Calls 2
public function deriveStatement(Derivation $derivation): void

Derives the option values and checks the option names.

Parameters

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

Writes the request.

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 2