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_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_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_show_behavior(&mut self, behavior: ShowBehavior)
pub fn set_show_behavior(&mut self, behavior: ShowBehavior)
Sets how SHOW name resolves its name.
Sourcepub fn semantics(&self) -> Semantics
pub fn semantics(&self) -> Semantics
The meaning-changing choices the binder resolves into the plan.
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.