set
– set one or multiple session-level parameters
set module module ;
set alias alias as module module ;
set global name := expr ;
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;
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 foo
select 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 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;
set module foo;
set alias foo AS module std;
set global current_user_id :=
<uuid>'00ea8eaa-02f9-11ed-a676-6bd11cc6c557';
See also |