Struct coord::session::vars::Vars [−][src]
pub struct Vars {Show 15 fields
application_name: SessionVar<str>,
client_encoding: ServerVar<str>,
database: SessionVar<str>,
date_style: ServerVar<str>,
extra_float_digits: SessionVar<i32>,
failpoints: ServerVar<str>,
integer_datetimes: ServerVar<bool>,
qgm_optimizations: SessionVar<bool>,
search_path: ServerVar<[&'static str]>,
server_version: ServerVar<str>,
server_version_num: ServerVar<i32>,
sql_safe_updates: SessionVar<bool>,
standard_conforming_strings: ServerVar<bool>,
timezone: ServerVar<str>,
transaction_isolation: ServerVar<str>,
}
Expand description
Session variables.
Materialize roughly follows the PostgreSQL configuration model, which works
as follows. There is a global set of named configuration parameters, like
DateStyle
and client_encoding
. These parameters can be set in several
places: in an on-disk configuration file (in Postgres, named
postgresql.conf), in command line arguments when the server is started, or
at runtime via the ALTER SYSTEM
or SET
statements. Parameters that are
set in a session take precedence over database defaults, which in turn take
precedence over command line arguments, which in turn take precedence over
settings in the on-disk configuration. Note that changing the value of
parameters obeys transaction semantics: if a transaction fails to commit,
any parameters that were changed in that transaction (i.e., via SET
)
will be rolled back to their previous value.
The Materialize configuration hierarchy at the moment is much simpler. Global defaults are hardcoded into the binary, and a select few parameters can be overridden per session. The infrastructure has been designed with an eye towards supporting additional layers to the hierarchy, however, should the need arise.
The configuration parameters that exist are driven by compatibility with PostgreSQL drivers that expect them, not because they are particularly important.
Fields
application_name: SessionVar<str>
client_encoding: ServerVar<str>
database: SessionVar<str>
date_style: ServerVar<str>
extra_float_digits: SessionVar<i32>
failpoints: ServerVar<str>
integer_datetimes: ServerVar<bool>
qgm_optimizations: SessionVar<bool>
search_path: ServerVar<[&'static str]>
server_version: ServerVar<str>
server_version_num: ServerVar<i32>
sql_safe_updates: SessionVar<bool>
standard_conforming_strings: ServerVar<bool>
timezone: ServerVar<str>
transaction_isolation: ServerVar<str>
Implementations
Returns an iterator over the configuration parameters and their current values for this session.
Returns an iterator over configuration parameters (and their current values for this session) that are expected to be sent to the client when a new connection is established or when their value changes.
Returns a Var
representing the configuration parameter with the
specified name.
Configuration parameters are matched case insensitively. If no such
configuration parameter exists, get
returns an error.
Note that if name
is known at compile time, you should instead use the
named accessor to access the variable with its true Rust type. For
example, self.get("sql_safe_updates").value()
returns the string
"true"
or "false"
, while self.sql_safe_updates()
returns a bool.
Sets the configuration parameter named name
to the value represented
by value
.
The new value may be either committed or rolled back by the next call to
Vars::end_transaction
. If local
is true, the new value is always
discarded by the next call to Vars::end_transaction
, even if the
transaction is marked to commit.
Like with Vars::get
, configuration parameters are matched case
insensitively. If value
is not valid, as determined by the underlying
configuration parameter, or if the named configuration parameter does
not exist, an error is returned.
Commits or rolls back configuration parameter updates made via
Vars::set
since the last call to end_transaction
.
Returns the value of the application_name
configuration parameter.
Returns the value of the client_encoding
configuration parameter.
Returns the value of the DateStyle
configuration parameter.
Returns the value of the extra_float_digits
configuration parameter.
Returns the value of the integer_datetimes
configuration parameter.
Returns the value of the qgm_optimizations
configuration parameter.
Returns the value of the search_path
configuration parameter.
Returns the value of the server_version
configuration parameter.
Returns the value of the server_version_num
configuration parameter.
Returns the value of the sql_safe_updates
configuration parameter.
Returns the value of the standard_conforming_strings
configuration
parameter.
Returns the value of the timezone
configuration parameter.
Returns the value of the transaction_isolation
configuration
parameter.
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for Vars
impl UnwindSafe for Vars
Blanket Implementations
Mutably borrows from an owned value. Read more
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more