classDatabaseRule
final class DatabaseRule
Lowers the database and tablespace commands.
Rule: PG-DATABASE-LOWER-001. Scope: CreatedbStmt, createdb_opt_list, createdb_opt_items, createdb_opt_item, createdb_opt_name, opt_equal, AlterDatabaseStmt, AlterDatabaseSetStmt, DropdbStmt, drop_option_list, drop_option, CreateTableSpaceStmt, OptTableSpaceOwner, DropTableSpaceStmt, AlterTblSpcStmt. Constructors: CreateDatabase, AlterDatabase, MoveDatabase, RefreshDatabaseCollation, AlterDatabaseSetting, DropDatabase, DatabaseOption, CreateTablespace, DropTablespace, AlterTablespaceOptions. The optional = of a database option and the optional WITH before database options are noise (CatalogNoise). Termination: lists are flattened iteratively. Source: https://www.postgresql.org/docs/17/sql-createdatabase.html, https://www.postgresql.org/docs/17/sql-alterdatabase.html, https://www.postgresql.org/docs/17/sql-dropdatabase.html, https://www.postgresql.org/docs/17/sql-createtablespace.html, https://www.postgresql.org/docs/17/sql-altertablespace.html. Status: Implemented.
Methods§
Lowers a database or tablespace command.
Parameters
$statement | Node |
Returns
Throws
ImplementationGap When the production has no ruleCalled from 1
Calls 13
- new CreateDatabase line 77
- method-call DatabaseRule::options() line 77
- new AlterDatabase line 78
- new MoveDatabase line 80
- new RefreshDatabaseCollation line 81
- new AlterDatabaseSetting line 82
- new DropDatabase line 83
- method-call DatabaseRule::dropOptions() line 85
- new CreateTablespace line 87
- method-call DatabaseRule::owner() line 87
- new DropTablespace line 88
- new AlterTablespaceOptions line 90
- static-call ImplementationGap::production() line 92
public function options(Node $list): list<DatabaseOption>Lowers createdb_opt_list; an empty list has no options.
Parameters
$list | Node |
Returns
list<DatabaseOption>Throws
ImplementationGap When the production has no ruleTest cases 1
Called from 3
- method-call SqlSemantics\Platform\PostgreSql\Lowering\Catalog\DatabaseRule::statement() packages/sql-semantics-postgres/src/Lowering/Catalog/DatabaseRule.php:77
- method-call SqlSemantics\Platform\PostgreSql\Lowering\Catalog\DatabaseRule::statement() packages/sql-semantics-postgres/src/Lowering/Catalog/DatabaseRule.php:78
- method-call SqlSemantics\Platform\PostgreSql\Lowering\Catalog\DatabaseRule::statement() packages/sql-semantics-postgres/src/Lowering/Catalog/DatabaseRule.php:79
Calls 3
- static-call ImplementationGap::production() line 110
- method-call Lowering::items() line 113
- method-call DatabaseRule::option() line 114
public function option(Node $item): DatabaseOptionLowers createdb_opt_item.
Parameters
$item | Node |
Returns
Throws
ImplementationGap When the production has no ruleTest cases 1
Called from 1
Calls 5
- method-call DatabaseRule::equal() line 128
- class-const DatabaseRule::KEYWORDS() line 132
- static-call ImplementationGap::production() line 132
- new DatabaseOption line 135
- class-const DefaultSetting::Default() line 138
public function equal(Node $equal): voidAccepts opt_equal, whose = is noise.
Parameters
$equal | Node |
Throws
ImplementationGap When the production has no ruleTest cases 1
Called from 1
Calls 1
- static-call ImplementationGap::production() line 152
public function dropOptions(Node $list): list<DropDatabaseOption>Lowers drop_option_list.
Parameters
$list | Node |
Returns
list<DropDatabaseOption>Throws
ImplementationGap When the production has no ruleTest cases 1
Called from 2
- method-call SqlSemantics\Platform\PostgreSql\Lowering\Catalog\DatabaseRule::statement() packages/sql-semantics-postgres/src/Lowering/Catalog/DatabaseRule.php:85
- method-call SqlSemantics\Platform\PostgreSql\Lowering\Catalog\DatabaseRule::statement() packages/sql-semantics-postgres/src/Lowering/Catalog/DatabaseRule.php:86
Calls 3
- method-call Lowering::items() line 166
- class-const DropDatabaseOption::Force() line 168
- static-call ImplementationGap::production() line 168
Lowers OptTableSpaceOwner; no owner is null.
Parameters
$owner | Node |
Returns
Throws
ImplementationGap When the production has no ruleTest cases 1
Called from 1
Calls 1
- static-call ImplementationGap::production() line 186
Private surface 2§
Implementation details, listed for orientation only.
private const KEYWORDS = ['createdb_opt_name: CONNECTION LIMIT' => \SqlSemantics\Platform\PostgreSql\Sta…private Lowering $loweringTest cases 5§
Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.