View Source EdgeDB.Client.State (EdgeDB v0.7.0)

State for the client is an execution context that affects the execution of EdgeQL commands in different ways:

  1. default module.
  2. module aliases.
  3. session config.
  4. global values.

The most convenient way to work with the state is to use the EdgeDB API to change a required part of the state.

See EdgeDB.with_client_state/2, EdgeDB.with_default_module/2, EdgeDB.with_module_aliases/2/EdgeDB.without_module_aliases/2, EdgeDB.with_config/2/EdgeDB.without_config/2 and EdgeDB.with_globals/2/EdgeDB.without_globals/2 for more information.

Summary

Types

Config to be passed to EdgeDB.with_config/2.

Keys that EdgeDB accepts for changing client behaviour configuration.

t()

State for the client is an execution context that affects the execution of EdgeQL commands.

Functions

Returns an EdgeDB.Client.State with adjusted session config.

Returns an EdgeDB.Client.State with adjusted default module.

Returns an EdgeDB.Client.State with adjusted global values.

Returns an EdgeDB.Client.State with adjusted module aliases.

Returns an EdgeDB.Client.State without specified session config.

Returns an EdgeDB.Client.State without specified globals.

Returns an EdgeDB.Client.State without specified module aliases.

Types

Link to this type

config()

View Source (since 0.7.0)
@type config() :: %{required(config_key()) => term()} | [{config_key(), term()}]

Config to be passed to EdgeDB.with_config/2.

Link to this type

config_key()

View Source (since 0.7.0)
@type config_key() ::
  :allow_user_specified_id
  | :session_idle_timeout
  | :session_idle_transaction_timeout
  | :query_execution_timeout

Keys that EdgeDB accepts for changing client behaviour configuration.

The meaning and acceptable values can be found in the docs.

@opaque t()

State for the client is an execution context that affects the execution of EdgeQL commands.

Functions

Link to this function

with_config(state, config \\ %{})

View Source
@spec with_config(t(), config()) :: t()

Returns an EdgeDB.Client.State with adjusted session config.

This is equivalent to using the configure session set command.

Link to this function

with_default_module(state, module \\ nil)

View Source
@spec with_default_module(t(), String.t() | nil) :: t()

Returns an EdgeDB.Client.State with adjusted default module.

This is equivalent to using the set module command, or using the reset module command when giving nil.

Link to this function

with_globals(state, globals \\ %{})

View Source
@spec with_globals(t(), %{required(String.t()) => String.t()}) :: t()

Returns an EdgeDB.Client.State with adjusted global values.

This is equivalent to using the set global command.

Link to this function

with_module_aliases(state, aliases \\ %{})

View Source
@spec with_module_aliases(t(), %{required(String.t()) => String.t()}) :: t()

Returns an EdgeDB.Client.State with adjusted module aliases.

This is equivalent to using the set alias command.

Link to this function

without_config(state, config_keys \\ [])

View Source
@spec without_config(t(), [config_key()]) :: t()

Returns an EdgeDB.Client.State without specified session config.

This is equivalent to using the configure session reset command.

Link to this function

without_globals(state, global_names \\ [])

View Source
@spec without_globals(t(), [String.t()]) :: t()

Returns an EdgeDB.Client.State without specified globals.

This is equivalent to using the reset global command.

Link to this function

without_module_aliases(state, aliases \\ [])

View Source
@spec without_module_aliases(t(), [String.t()]) :: t()

Returns an EdgeDB.Client.State without specified module aliases.

This is equivalent to using the reset alias command.