pub enum Set {
SingleAssignment {
scope: Option<ContextModifier>,
hivevar: bool,
variable: ObjectName,
values: Vec<Expr>,
},
ParenthesizedAssignments {
variables: Vec<ObjectName>,
values: Vec<Expr>,
},
MultipleAssignments {
assignments: Vec<SetAssignment>,
},
SetSessionAuthorization(SetSessionAuthorizationParam),
SetSessionParam(SetSessionParamKind),
SetRole {
context_modifier: Option<ContextModifier>,
role_name: Option<Ident>,
},
SetTimeZone {
local: bool,
value: Expr,
},
SetNames {
charset_name: Ident,
collation_name: Option<String>,
},
SetNamesDefault {},
SetTransaction {
modes: Vec<TransactionMode>,
snapshot: Option<Value>,
session: bool,
},
}Expand description
Variants for the SET family of statements.
SQL Standard-style
SET a = 1;
SET var = value (standard SQL-style assignment).
Fields
Optional scope modifier (SESSION / LOCAL).
Whether this is a Hive-style HIVEVAR: assignment.
Values assigned to the variable.
Snowflake-style
SET (a, b, ..) = (1, 2, ..);
SET (a, b) = (1, 2) (tuple assignment syntax).
Fields
Variables being assigned in tuple form.
Corresponding values for the variables.
MySQL-style
SET a = 1, b = 2, ..;
SET a = 1, b = 2 (MySQL-style comma-separated assignments).
Fields
List of SET assignments (MySQL-style comma-separated).
Fields
Non-ANSI optional identifier to inform if the role is defined inside the current session (SESSION) or transaction (LOCAL).
Role name. If NONE is specified, then the current role name is removed.
Note: this is a PostgreSQL-specific statements
SET TIME ZONE <value> is an alias for SET timezone TO <value> in PostgreSQL
However, we allow it for all dialects.
SET TIME ZONE statement. local indicates the LOCAL keyword.
SET TIME ZONE <value> statement.
Fields
Whether the LOCAL keyword was specified.
Time zone expression value.
SET NAMES 'charset_name' [COLLATE 'collation_name']Fields
Character set name to set.
Note: this is a MySQL-specific statement.
Fields
Transaction modes (e.g., ISOLATION LEVEL, READ ONLY).
Optional snapshot value for transaction snapshot control.
true when the SESSION keyword was used.