classSetParameterFrom
final class SetParameterFrom
implements Statement
uses Snapshot
Public API: explicitly declared with
@visibility public.SET [LOCAL] parameter TO DEFAULT or SET [LOCAL] parameter FROM CURRENT: a parameter set without a written value.
Rule: PG-SET-002. Mirrors PostgreSQL's VariableSetStmt of kind VAR_SET_DEFAULT or VAR_SET_CURRENT. TO DEFAULT and = DEFAULT are the same request. Facts: none. Source: https://www.postgresql.org/docs/17/sql-set.html. Status: Implemented.
$operation = (new \SqlSemantics\Platform\PostgreSql\Semantics())->analyze('SET work_mem = DEFAULT');
[$operation->statement->source, $operation->toString()] // => [\SqlSemantics\Platform\PostgreSql\Statement\Utility\Session\ParameterSource::Default, 'SET work_mem TO DEFAULT']Properties§
public ParameterName $parameterpublic ParameterSource $sourcepublic bool $local = falseMethods§
public function __construct(
public ParameterName $parameter,
public ParameterSource $source,
public bool $local = false,
)Parameters
$parameter | ParameterName | The parameter |
$source | ParameterSource | Where the value comes from |
$local | bool | Whether the change lasts for the current transaction only |
public function deriveStatement(Derivation $derivation): voidDerives nothing: a configuration parameter is not part of a declaration context.
Parameters
$derivation | Derivation |
public function render(Output $out): voidWrites the request.
Parameters
$out | Output |
Calls 4
- method-call Output::keyword() line 50
- method-call Output::node() line 54
- class-const ParameterSource::Default() line 56
- class-const ParameterSource::Current() line 57
Test cases 4§
Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.
Dedicated tests 1
SetParameterFromTestcalls
Other tests reaching this symbol 3
Relations§
Instantiated in 2
Type checks 1
Type declarations 2
- type SqlSemantics\Platform\PostgreSql\Lowering\Utility\SettingRule packages/sql-semantics-postgres/src/Lowering/Utility/SettingRule.php:181
- type SqlSemantics\Platform\PostgreSql\Statement\Utility\Session\AlterSystemSetting packages/sql-semantics-postgres/src/Statement/Utility/Session/AlterSystemSetting.php:39