classShow
final class Show
implements Statement
uses Snapshot
@visibility public.SHOW parameter, SHOW ALL or a keyword form: the current value of a configuration parameter.
Rule: PG-SHOW-001. Mirrors PostgreSQL's VariableShowStmt. Facts: SHOW ALL returns the text columns name, setting and description, of which a setting or description may be absent; a keyword form returns one text column named after the parameter it stands for (TimeZone, transaction_isolation, session_authorization). A named parameter returns one text column named as the server registered the parameter, which may differ in letter case from the name written and is unknown for the parameter of an extension, so the row depends on the server's parameter registry. Termination: no recursion. Source: https://www.postgresql.org/docs/17/sql-show.html. Status: Implemented.
$operation = (new \SqlSemantics\Platform\PostgreSql\Semantics())->analyze('SHOW ALL');
[$operation->field(0)->name->value, $operation->field(1)->name->value, $operation->field(2)->name->value] // => ['name', 'setting', 'description']$operation = (new \SqlSemantics\Platform\PostgreSql\Semantics())->analyze('SHOW work_mem');
[$operation->shape()->complete(), $operation->shape()->missing[0]->describe()] // => [false, 'the session state: the registered name of the configuration parameter work_mem']Properties§
public ParameterName|SpecialParameter $parameterMethods§
public function __construct(public ParameterName|SpecialParameter $parameter)Parameters
$parameter | ParameterName|SpecialParameter | The parameter, or the keywords that name one or all |
public function deriveStatement(Derivation $derivation): voidRecords the row SHOW returns.
Parameters
$derivation | Derivation |
Calls 15
- new Known line 59
- class-const Builtin::Text() line 59
- class-const SpecialParameter::All() line 61
- new Field line 62
- new OutputSlot line 62
- new Name line 62
- class-const Nullability::NotNull() line 62
- class-const Nullability::Nullable() line 63
- class-const SpecialParameter::TimeZone() line 66
- class-const SpecialParameter::TransactionIsolationLevel() line 67
- class-const SpecialParameter::SessionAuthorization() line 68
- new OpenStar line 69
- new SessionState line 69
- method-call Derivation::output() line 71
- new QueryFact line 71
public function render(Output $out): voidWrites the request.
Parameters
$out | Output |
Calls 3
- method-call Output::keyword() line 79
- function-call
explodeline 81 - method-call Output::node() line 85
Test cases 1§
Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.
Dedicated tests 1
ShowTestcalls
Relations§
Instantiated in 2
- new SqlSemantics\Platform\PostgreSql\Lowering\Utility\SettingRule::statement() packages/sql-semantics-postgres/src/Lowering/Utility/SettingRule.php:102
- new SqlSemantics\Platform\PostgreSql\Lowering\Utility\SettingRule::statement() packages/sql-semantics-postgres/src/Lowering/Utility/SettingRule.php:107