View Source EdgeDB.State (EdgeDB v0.4.0)

State 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_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.

Link to this section Summary

Types

t()

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

Functions

Returns an EdgeDB.State with adjusted session config.

Returns an EdgeDB.State with adjusted default module.

Returns an EdgeDB.State with adjusted global values.

Returns an EdgeDB.State with adjusted module aliases.

Returns an EdgeDB.State without specified session config.

Returns an EdgeDB.State without specified globals.

Returns an EdgeDB.State without specified module aliases.

Link to this section Types

@opaque t()

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

Link to this section Functions

Link to this function

with_config(state, config \\ %{})

View Source
@spec with_config(t(), %{required(atom()) => term()}) :: t()

Returns an EdgeDB.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.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.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.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(), [atom()]) :: t()

Returns an EdgeDB.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.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.State without specified module aliases.

This is equivalent to using the reset alias command.