pub struct SessionVars {
Show 25 fields application_name: SessionVar<str>, build_info: &'static BuildInfo, client_encoding: ServerVar<str>, client_min_messages: SessionVar<ClientSeverity>, cluster: SessionVar<str>, cluster_replica: SessionVar<Option<String>>, database: SessionVar<str>, date_style: &'static ServerVar<Vec<String>>, extra_float_digits: SessionVar<i32>, failpoints: ServerVar<str>, integer_datetimes: ServerVar<bool>, interval_style: ServerVar<str>, search_path: SessionVar<Vec<Ident>>, server_version: ServerVar<str>, server_version_num: ServerVar<i32>, sql_safe_updates: SessionVar<bool>, standard_conforming_strings: ServerVar<bool>, statement_timeout: SessionVar<Duration>, idle_in_transaction_session_timeout: SessionVar<Duration>, timezone: SessionVar<TimeZone>, transaction_isolation: SessionVar<IsolationLevel>, real_time_recency: SessionVar<bool>, emit_timestamp_notice: SessionVar<bool>, emit_trace_id_notice: SessionVar<bool>, is_superuser: SessionVar<bool>,
}
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. A select few parameters can be overridden on disk.

The set of variables that can be overridden per session and the set of variables that can be overridden on disk are currently disjoint. The infrastructure has been designed with an eye towards merging these two sets and 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>§build_info: &'static BuildInfo§client_encoding: ServerVar<str>§client_min_messages: SessionVar<ClientSeverity>§cluster: SessionVar<str>§cluster_replica: SessionVar<Option<String>>§database: SessionVar<str>§date_style: &'static ServerVar<Vec<String>>§extra_float_digits: SessionVar<i32>§failpoints: ServerVar<str>§integer_datetimes: ServerVar<bool>§interval_style: ServerVar<str>§search_path: SessionVar<Vec<Ident>>§server_version: ServerVar<str>§server_version_num: ServerVar<i32>§sql_safe_updates: SessionVar<bool>§standard_conforming_strings: ServerVar<bool>§statement_timeout: SessionVar<Duration>§idle_in_transaction_session_timeout: SessionVar<Duration>§timezone: SessionVar<TimeZone>§transaction_isolation: SessionVar<IsolationLevel>§real_time_recency: SessionVar<bool>§emit_timestamp_notice: SessionVar<bool>§emit_trace_id_notice: SessionVar<bool>§is_superuser: SessionVar<bool>

Implementations§

Creates a new SessionVars.

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 SessionVars::end_transaction. If local is true, the new value is always discarded by the next call to SessionVars::end_transaction, even if the transaction is marked to commit.

Like with SessionVars::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.

Sets the configuration parameter named name to its default value.

The new value may be either committed or rolled back by the next call to SessionVars::end_transaction. If local is true, the new value is always discarded by the next call to SessionVars::end_transaction, even if the transaction is marked to commit.

Like with SessionVars::get, configuration parameters are matched case insensitively. If the named configuration parameter does not exist, an error is returned.

Commits or rolls back configuration parameter updates made via SessionVars::set since the last call to end_transaction.

Returns the value of the application_name configuration parameter.

Returns the build info.

Returns the value of the client_encoding configuration parameter.

Returns the value of the client_min_messages configuration parameter.

Returns the value of the cluster configuration parameter.

Returns the value of the cluster_replica configuration parameter.

Returns the value of the DateStyle configuration parameter.

Returns the value of the database 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 intervalstyle configuration parameter.

Returns the value of the mz_version 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 statement_timeout configuration parameter.

Returns the value of the idle_in_transaction_session_timeout configuration parameter.

Returns the value of the timezone configuration parameter.

Returns the value of the transaction_isolation configuration parameter.

Returns the value of real_time_recency configuration parameter.

Returns the value of emit_timestamp_notice configuration parameter.

Returns the value of emit_trace_id_notice configuration parameter.

Returns the value of is_superuser configuration parameter.

Trait Implementations§

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Attaches the provided Context to this type, returning a WithContext wrapper. Read more
Attaches the current Context to this type, returning a WithContext wrapper. Read more
Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Wrap the input message T in a tonic::Request
The alignment of pointer.
The type for initializers.
Initializes a with the given initializer. Read more
Dereferences the given pointer. Read more
Mutably dereferences the given pointer. Read more
Drops the object pointed to by the given pointer. Read more
Should always be Self
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.
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