pub struct Session { /* private fields */ }Expand description
The settings a session has, by name.
Every setting the engine has, not only the ones somebody changed. A reader of this is answering “what is it now”, so a name that is missing means the engine does not have that setting rather than that it is at its default.
Implementations§
Source§impl Session
impl Session
Sourcepub fn new() -> Self
pub fn new() -> Self
A session that knows nothing, which is what a caller with no database behind it has.
Sourcepub fn set_time_zone(&mut self, name: &str)
pub fn set_time_zone(&mut self, name: &str)
Sets the time zone after it has been validated by the setting layer.
Sourcepub fn session_time_zone(&self) -> SessionTimeZone
pub fn session_time_zone(&self) -> SessionTimeZone
The parsed zone used by prepared expressions.
Sourcepub fn set_default_descending(&mut self, descending: bool)
pub fn set_default_descending(&mut self, descending: bool)
Sets the direction used by an order item that names none.
Sourcepub fn set_default_null_order(&mut self, order: DefaultNullOrder)
pub fn set_default_null_order(&mut self, order: DefaultNullOrder)
Sets how an order item with no null placement is resolved.
Sourcepub fn set_integer_division(&mut self, enabled: bool)
pub fn set_integer_division(&mut self, enabled: bool)
Sets whether / is bound as the integer division operator.
Sourcepub fn set_ieee_floating_point_ops(&mut self, enabled: bool)
pub fn set_ieee_floating_point_ops(&mut self, enabled: bool)
Sets whether floating division and remainder use IEEE answers for zero divisors.
Sourcepub fn set_identifier_case(&mut self, case: IdentifierCase)
pub fn set_identifier_case(&mut self, case: IdentifierCase)
Sets how unquoted identifiers are folded while a statement is parsed.
Sourcepub fn set_null_on_division_by_zero(&mut self, enabled: bool)
pub fn set_null_on_division_by_zero(&mut self, enabled: bool)
Sets whether division errors caused by a zero divisor become nulls.
Sourcepub fn set_order_by_non_integer_literal(&mut self, enabled: bool)
pub fn set_order_by_non_integer_literal(&mut self, enabled: bool)
Sets whether a constant non-integer expression is accepted as a sort key.
Sourcepub fn set_disable_timestamptz_casts(&mut self, enabled: bool)
pub fn set_disable_timestamptz_casts(&mut self, enabled: bool)
Sets whether casts from local timestamps to zoned timestamps are refused.
Sourcepub fn set_errors_as_json(&mut self, enabled: bool)
pub fn set_errors_as_json(&mut self, enabled: bool)
Sets whether errors are returned as structured JSON.
Sourcepub fn set_regex_match_full(&mut self, enabled: bool)
pub fn set_regex_match_full(&mut self, enabled: bool)
Sets whether regex match operators require the entire string to match.
Sourcepub fn set_scalar_subquery_error_on_multiple_rows(&mut self, enabled: bool)
pub fn set_scalar_subquery_error_on_multiple_rows(&mut self, enabled: bool)
Sets whether scalar queries may choose one row from several.
Sourcepub fn set_show_behavior(&mut self, behavior: ShowBehavior)
pub fn set_show_behavior(&mut self, behavior: ShowBehavior)
Sets how SHOW name resolves its name.
Sourcepub fn set_warnings_as_errors(&mut self, enabled: bool)
pub fn set_warnings_as_errors(&mut self, enabled: bool)
Sets whether warnings are promoted to errors.
Sourcepub fn semantics(&self) -> Semantics
pub fn semantics(&self) -> Semantics
The meaning-changing choices the binder resolves into the plan.
Sourcepub fn set_rules(&mut self, rules: Rules)
pub fn set_rules(&mut self, rules: Rules)
Records which optimization rules the session has turned off.
Sourcepub fn rules(&self) -> Rules
pub fn rules(&self) -> Rules
Which optimization rules may fire for this statement.
Read by whatever is about to apply one, which is why it rides on the session rather than being reached for through the database: the rank that sets it and the ranks that obey it cannot see each other.
Sourcepub fn knows_time_zone(name: &str) -> bool
pub fn knows_time_zone(name: &str) -> bool
Whether the bundled time-zone database knows this name.
Sourcepub fn offset_seconds_at(&self, micros: i64) -> i32
pub fn offset_seconds_at(&self, micros: i64) -> i32
The UTC offset in seconds at an instant expressed as Unix microseconds.
Sourcepub fn local_micros(&self, micros: i64) -> i64
pub fn local_micros(&self, micros: i64) -> i64
A UTC instant shifted to the wall clock of this session.
Sourcepub fn get(&self, name: &str) -> Option<&str>
pub fn get(&self, name: &str) -> Option<&str>
What that setting is now, and None for a name this session has no answer for.