pub struct Vars {
Show 20 fields application_name: SessionVar<str>, client_encoding: ServerVar<str>, client_min_messages: SessionVar<ClientSeverity>, cluster: SessionVar<str>, cluster_replica: SessionVar<Option<String>>, database: SessionVar<str>, date_style: ServerVar<str>, extra_float_digits: SessionVar<i32>, failpoints: ServerVar<str>, integer_datetimes: ServerVar<bool>, interval_style: ServerVar<str>, qgm_optimizations: SessionVar<bool>, search_path: SessionVar<[String]>, server_version: ServerVar<str>, server_version_num: ServerVar<i32>, sql_safe_updates: SessionVar<bool>, standard_conforming_strings: ServerVar<bool>, statement_timeout: SessionVar<Duration>, timezone: SessionVar<TimeZone>, 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>client_min_messages: SessionVar<ClientSeverity>cluster: SessionVar<str>cluster_replica: SessionVar<Option<String>>database: SessionVar<str>date_style: ServerVar<str>extra_float_digits: SessionVar<i32>failpoints: ServerVar<str>integer_datetimes: ServerVar<bool>interval_style: ServerVar<str>qgm_optimizations: SessionVar<bool>search_path: SessionVar<[String]>server_version: ServerVar<str>server_version_num: ServerVar<i32>sql_safe_updates: SessionVar<bool>standard_conforming_strings: ServerVar<bool>statement_timeout: SessionVar<Duration>timezone: SessionVar<TimeZone>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.

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 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 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 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 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 statement_timeout configuration parameter.

Returns the value of the timezone configuration parameter.

Returns the value of the transaction_isolation configuration parameter.

Trait Implementations

Formats the value using the given formatter. Read more

Returns the “default value” for a type. 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

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