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.

Restoring a defaultdoctest
$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 $parameter
public bool $local = false

Methods§

public function __construct(
    public ParameterName $parameter,
    public ParameterSource $source,
    public bool $local = false,
)

Parameters

$parameterParameterNameThe parameter
$sourceParameterSourceWhere the value comes from
$localboolWhether the change lasts for the current transaction only
public function deriveStatement(Derivation $derivation): void

Derives nothing: a configuration parameter is not part of a declaration context.

Parameters

$derivationDerivation
public function render(Output $out): void

Writes the request.

Parameters

$outOutput
Calls 4

Test cases 4§

Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.

Dedicated tests 1
Other tests reaching this symbol 3

Relations§

Instantiated in 2
Type checks 1
Type declarations 2