classSetSpecialSetting
final class SetSpecialSetting
implements Statement
uses Snapshot
@visibility public.A SET written with keywords of its own: CATALOG, SCHEMA, NAMES, ROLE, SESSION AUTHORIZATION, XML OPTION or TRANSACTION SNAPSHOT.
Rule: PG-SET-004. Mirrors the keyword forms of PostgreSQL's VariableSetStmt. CATALOG, SCHEMA and TRANSACTION SNAPSHOT take a string; ROLE takes a word or a string; SESSION AUTHORIZATION takes a word, a string or DEFAULT; NAMES takes a string, DEFAULT or nothing, the last two both restoring the default encoding; XML OPTION takes DOCUMENT or CONTENT. Diagnostic: SET CATALOG is rejected by the server while parsing. Source: https://www.postgresql.org/docs/17/sql-set.html, https://www.postgresql.org/docs/17/sql-set-role.html, https://www.postgresql.org/docs/17/sql-set-session-authorization.html, https://www.postgresql.org/docs/17/sql-set-transaction.html. Status: Implemented.
$operation = (new \SqlSemantics\Platform\PostgreSql\Semantics())->analyze('SET SESSION AUTHORIZATION DEFAULT');
[$operation->statement->setting, $operation->statement->default, $operation->statement->value] // => [\SqlSemantics\Platform\PostgreSql\Statement\Utility\Session\SpecialSetting::SessionAuthorization, true, null]new \SqlSemantics\Platform\PostgreSql\Statement\Utility\Session\SetSpecialSetting(\SqlSemantics\Platform\PostgreSql\Statement\Utility\Session\SpecialSetting::Schema, null) // throws \SqlSemantics\Platform\PostgreSql\Model\Diagnostic\InvalidConstructionProperties§
public SpecialSetting $settingpublic StringConstant|Word|XmlOption|null $valuepublic bool $default = falsepublic bool $local = falseMethods§
public function __construct(
public SpecialSetting $setting,
public StringConstant|Word|XmlOption|null $value,
public bool $default = false,
public bool $local = false,
)Parameters
$setting | SpecialSetting | The setting |
$value | StringConstant|Word|XmlOption|null | The value; null when DEFAULT or nothing is written |
$default | bool | Whether DEFAULT is written in place of a value |
$local | bool | Whether the change lasts for the current transaction only |
Calls 8
- static-call Check::input() line 54
- class-const SpecialSetting::Catalog() line 56
- class-const SpecialSetting::Schema() line 56
- class-const SpecialSetting::TransactionSnapshot() line 56
- class-const SpecialSetting::Names() line 57
- class-const SpecialSetting::Role() line 58
- class-const SpecialSetting::SessionAuthorization() line 59
- class-const SpecialSetting::XmlOption() line 60
public function deriveStatement(Derivation $derivation): voidReports SET CATALOG, which the server refuses.
Parameters
$derivation | Derivation |
Calls 4
- class-const SpecialSetting::Catalog() line 69
- method-call Derivation::report() line 70
- new UtilityProblem line 70
- class-const UtilityProblemKind::CatalogChange() line 70
public function render(Output $out): voidWrites the request.
Parameters
$out | Output |
Calls 3
- method-call Output::keyword() line 79
- function-call
explodeline 83 - method-call Output::node() line 90
Test cases 2§
Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.
Dedicated tests 1
SetSpecialSettingTestcalls
Other tests reaching this symbol 1
Relations§
Instantiated in 10
- new SqlSemantics\Platform\PostgreSql\Lowering\Utility\SettingRule::more() packages/sql-semantics-postgres/src/Lowering/Utility/SettingRule.php:164
- new SqlSemantics\Platform\PostgreSql\Lowering\Utility\SettingRule::more() packages/sql-semantics-postgres/src/Lowering/Utility/SettingRule.php:165
- new SqlSemantics\Platform\PostgreSql\Lowering\Utility\SettingRule::more() packages/sql-semantics-postgres/src/Lowering/Utility/SettingRule.php:167
- new SqlSemantics\Platform\PostgreSql\Lowering\Utility\SettingRule::more() packages/sql-semantics-postgres/src/Lowering/Utility/SettingRule.php:168
- new SqlSemantics\Platform\PostgreSql\Lowering\Utility\SettingRule::more() packages/sql-semantics-postgres/src/Lowering/Utility/SettingRule.php:169
- new SqlSemantics\Platform\PostgreSql\Lowering\Utility\SettingRule::more() packages/sql-semantics-postgres/src/Lowering/Utility/SettingRule.php:170
- new SqlSemantics\Platform\PostgreSql\Lowering\Utility\SettingRule::more() packages/sql-semantics-postgres/src/Lowering/Utility/SettingRule.php:171
- new SqlSemantics\Platform\PostgreSql\Lowering\Utility\SettingRule::names() packages/sql-semantics-postgres/src/Lowering/Utility/SettingRule.php:233
- new SqlSemantics\Platform\PostgreSql\Lowering\Utility\SettingRule::names() packages/sql-semantics-postgres/src/Lowering/Utility/SettingRule.php:234
- new SqlSemantics\Platform\PostgreSql\Lowering\Utility\SettingRule::names() packages/sql-semantics-postgres/src/Lowering/Utility/SettingRule.php:235