classShowGrants
final class ShowGrants
implements Statement
uses Snapshot
Public API: explicitly declared with
@visibility public.SHOW GRANTS: the GRANT statements that reproduce the privileges of an account or role.
Rule: MYSQL-SHOW-GRANTS-001. One column, named Grants for user@host after the account written (host % when none is written). Without FOR, or with FOR CURRENT_USER, the account is the current user of the session, so the column name depends on it and the shape is open. USING (8.0 and later) names roles whose privileges are shown as granted to the account. Terminates: a fixed layout. Source: https://dev.mysql.com/doc/refman/8.4/en/show-grants.html. Status: Implemented.
$show = (new \SqlSemantics\Platform\MySql\Semantics())->analyze("SHOW GRANTS FOR 'u'@'localhost' USING r");
[$show->field(0)->name?->value, $show->toString()] // => ['Grants for u@localhost', 'SHOW GRANTS FOR u@localhost USING r']Properties§
public list<Account> $usingpublic Account|null $user = nullMethods§
Parameters
Calls 3
- static-call Check::listOf() line 50
- class-const Account::class() line 50
- static-call Check::input() line 51
public function deriveStatement(Derivation $derivation): voidDerives the rows.
Parameters
$derivation | Derivation |
Calls 7
- new ShowFacts line 59
- method-call Derivation::output() line 61
- method-call ShowFacts::query() line 61
- method-call ShowFacts::open() line 61
- new SessionState line 61
- method-call ShowFacts::shape() line 66
- class-const Report::Grants() line 66
public function render(Output $out): voidTest cases 2§
Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.
Dedicated tests 2
Relations§
Instantiated in 5
- new SqlSemantics\Platform\MySql\Lowering\Utility\Show\LegacyObjectRule::server() packages/sql-semantics-mysql/src/Lowering/Utility/Show/LegacyObjectRule.php:194
- new SqlSemantics\Platform\MySql\Lowering\Utility\Show\LegacyObjectRule::server() packages/sql-semantics-mysql/src/Lowering/Utility/Show/LegacyObjectRule.php:195
- new SqlSemantics\Platform\MySql\Lowering\Utility\Show\ServerRule::statement() packages/sql-semantics-mysql/src/Lowering/Utility/Show/ServerRule.php:84
- new SqlSemantics\Platform\MySql\Lowering\Utility\Show\ServerRule::statement() packages/sql-semantics-mysql/src/Lowering/Utility/Show/ServerRule.php:86
- new SqlSemantics\Platform\MySql\Lowering\Utility\Show\ServerRule::statement() packages/sql-semantics-mysql/src/Lowering/Utility/Show/ServerRule.php:88