classGrantRule
final class GrantRule
Lowers GRANT and REVOKE of privileges on objects.
Rule: PG-GRANT-LOWER-001. Scope: GrantStmt, RevokeStmt, privilege_target, parameter_name_list, parameter_name. Constructors: Grant, Revoke and the PrivilegeTarget classes; the shared parts are lowered by PG-PRIVILEGE-LOWER-001. The word TABLE before relation names is noise (AccessNoise). Termination: lists are flattened iteratively. Source: https://www.postgresql.org/docs/17/sql-grant.html, https://www.postgresql.org/docs/17/sql-revoke.html. Status: Implemented.
Methods§
Lowers GrantStmt or RevokeStmt.
Parameters
$statement | Node |
Returns
Throws
ImplementationGap When the production has no ruleTest cases 2
Called from 1
Calls 9
- new PrivilegeRule line 104
- new Grant line 108
- method-call PrivilegeRule::privileges() line 108
- method-call GrantRule::target() line 108
- method-call PrivilegeRule::grantees() line 108
- method-call PrivilegeRule::grantOption() line 108
- method-call PrivilegeRule::grantor() line 108
- new Revoke line 109
- static-call ImplementationGap::production() line 111
public function target(Node $target): PrivilegeTargetLowers privilege_target.
Parameters
$target | Node |
Returns
Throws
ImplementationGap When the production has no ruleTest cases 3
Called from 3
- method-call SqlSemantics\Platform\PostgreSql\Lowering\Access\GrantRule::statement() packages/sql-semantics-postgres/src/Lowering/Access/GrantRule.php:108
- method-call SqlSemantics\Platform\PostgreSql\Lowering\Access\GrantRule::statement() packages/sql-semantics-postgres/src/Lowering/Access/GrantRule.php:109
- method-call SqlSemantics\Platform\PostgreSql\Lowering\Access\GrantRule::statement() packages/sql-semantics-postgres/src/Lowering/Access/GrantRule.php:110
Calls 15
- class-const GrantRule::RELATIONS() line 124
- new RelationReference line 127
- new RelationsTarget line 130
- class-const GrantRule::NAMED() line 132
- new NamedObjectsTarget line 133
- class-const GrantRule::ROUTINES() line 135
- new RoutinesTarget line 136
- class-const GrantRule::TYPES() line 138
- new TypesTarget line 139
- class-const GrantRule::SCHEMAS() line 141
- new SchemaContentsTarget line 142
- new LargeObjectsTarget line 146
- new ParametersTarget line 147
- method-call GrantRule::parameters() line 147
- static-call ImplementationGap::production() line 148
public function parameters(Node $list): list<ParameterName>Lowers parameter_name_list; each parameter_name is the list of its dotted parts.
Parameters
$list | Node |
Returns
list<ParameterName>Test cases 1
Called from 1
Calls 2
- method-call Lowering::items() line 160
- new ParameterName line 165
Private surface 6§
Implementation details, listed for orientation only.
private const RELATIONS = ['privilege_target: qualified_name_list' => [\SqlSemantics\Platform\PostgreSql\…private const NAMED = ['privilege_target: FOREIGN DATA_P WRAPPER name_list' => [\SqlSemantics\Platfor…private const ROUTINES = ['privilege_target: FUNCTION function_with_argtypes_list' => \SqlSemantics\Plat…private const TYPES = ['privilege_target: DOMAIN_P any_name_list' => \SqlSemantics\Platform\PostgreSq…private const SCHEMAS = ['privilege_target: ALL TABLES IN_P SCHEMA name_list' => \SqlSemantics\Platform…private Lowering $loweringTest cases 6§
Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.
Dedicated tests 6
GrantRuleTest::testParametersLowersDottedNamescallsGrantRuleTest::testStatementLowersGrantcallsGrantRuleTest::testStatementLowersRevokeOfTheGrantOptioncallsGrantRuleTest::testTargetLowersLargeObjectscallsGrantRuleTest::testTargetLowersRelationsWithoutTheNoiseWordcallsGrantRuleTest::testTargetLowersSchemaContentscalls