classComponentSetting
final class ComponentSetting
implements Node
uses Snapshot
Public API: explicitly declared with
@visibility public.One assignment of INSTALL COMPONENT … SET: [GLOBAL | PERSIST] [component.]variable = value.
Mirrors PT_install_component_set_element. The scope is the variable's scope: GLOBAL, PERSIST, or none, which the server takes as GLOBAL. The variable is written without at signs. The value is an expression or the word ON. Source: https://dev.mysql.com/doc/refman/8.4/en/install-component.html.
$install = (new \SqlSemantics\Platform\MySql\Semantics())->analyze("INSTALL COMPONENT 'file://c' SET PERSIST c.v = 4");
[$install->statement->settings[0]->variable->scope, $install->statement->settings[0]->variable->instance?->value] // => [\SqlSemantics\Platform\MySql\Statement\Variable\VariableScope::Persist, 'c']Properties§
public SystemVariable $variablepublic Scalar $valueMethods§
public function __construct(public SystemVariable $variable, public Scalar $value)Parameters
$variable | SystemVariable | The variable with its scope and component |
$value | Scalar | The value: an expression, or OnWord |
Throws
InvalidConstruction When the scope is neither absent, GLOBAL nor PERSISTCalls 4
- static-call Check::input() line 42
- function-call
in_arrayline 42 - class-const VariableScope::Global() line 42
- class-const VariableScope::Persist() line 42
public function render(Output $out): voidWrites the assignment.
Parameters
$out | Output |
Calls 3
- method-call Output::keyword() line 51
- method-call Output::name() line 54
- class-const NameUse::Label() line 54
Test cases 1§
Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.
Dedicated tests 1
ComponentSettingTestcalls