classAlterDatabase
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.
$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> $optionspublic Name $nameMethods§
public function __construct(public Name $name, list<DatabaseOption> $options = [])Parameters
$name | Name | The database name |
$options | list<DatabaseOption> | The options in the order written |
Calls 2
- static-call Check::listOf() line 45
- class-const DatabaseOption::class() line 45
public function deriveStatement(Derivation $derivation): voidDerives the option values and checks the option names.
Parameters
$derivation | Derivation |
Calls 4
- method-call ClauseFacts::derive() line 53
- new ClauseFacts line 53
- method-call OptionChecks::database() line 54
- new OptionChecks line 54
public function render(Output $out): voidWrites the request.
Parameters
$out | Output |
Calls 3
- method-call Output::keyword() line 62
- class-const NameUse::Column() line 62
- method-call Output::node() line 64
Test cases 2§
Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.
Dedicated tests 1
AlterDatabaseTestcalls
Other tests reaching this symbol 1
Relations§
Instantiated in 2
- new SqlSemantics\Platform\PostgreSql\Lowering\Catalog\DatabaseRule::statement() packages/sql-semantics-postgres/src/Lowering/Catalog/DatabaseRule.php:78
- new SqlSemantics\Platform\PostgreSql\Lowering\Catalog\DatabaseRule::statement() packages/sql-semantics-postgres/src/Lowering/Catalog/DatabaseRule.php:79