Set
set – set one or multiple session-level parameters
set module module ;set alias alias as module module ;set global name := expr ;
Description
This command allows altering the configuration of the current session.
Variations
set module module
Set the default module for the current section to module.
For example, if a module foo contains type FooType, the following is how the type can be referred to:
# Use the fully-qualified name.select foo::FooType;# Use the WITH clause to define the default module# for the query.with module foo select foo::FooType;# Set the default module for the current session ...set module foo;# ... and use an unqualified name.select FooType;
set alias alias as module module
Define alias for the module.
For example:
# Use the fully-qualified name.select foo::FooType;# Use the WITH clause to define a custom alias# for the "foo" module.with bar as module fooselect bar::FooType;# Define "bar" as an alias for the "foo" module for# the current session ...set alias bar as module foo;# ... and use "bar" instead of "foo".select bar::FooType;
set global name := expr
Set the global variable name to the specified value.
For example:
# Set the global variable "current_user_id".set global current_user_id :=<uuid>'00ea8eaa-02f9-11ed-a676-6bd11cc6c557';# We can now use that value in a query.select User { name }filter .id = global current_user_id;
Examples
set module foo;set alias foo AS module std;set global current_user_id :=<uuid>'00ea8eaa-02f9-11ed-a676-6bd11cc6c557';
︙
See also |