View Source EdgeDB.Set (EdgeDB v0.4.0)

A representation of an immutable set of values returned by a query. Nested sets in the result are also returned as EdgeDB.Set objects.

EdgeDB.Set implements Enumerable protocol for iterating over set values.

iex(1)> {:ok, pid} = EdgeDB.start_link()
iex(2)> %EdgeDB.Set{} =
iex(2)>  EdgeDB.query!(pid, "
...(2)>   select schema::ObjectType{
...(2)>     name
...(2)>   }
...(2)>   filter .name IN {'std::BaseObject', 'std::Object', 'std::FreeObject'}
...(2)>   order by .name
...(2)>  ")
#EdgeDB.Set<{#EdgeDB.Object<name := "std::BaseObject">, #EdgeDB.Object<name := "std::FreeObject">, #EdgeDB.Object<name := "std::Object">}>

Link to this section Summary

Types

t()

A representation of an immutable set of values returned by a query.

Functions

Check if set is empty.

Link to this section Types

@opaque t()

A representation of an immutable set of values returned by a query.

Link to this section Functions

@spec empty?(t()) :: boolean()

Check if set is empty.

iex(1)> {:ok, pid} = EdgeDB.start_link()
iex(2)> %EdgeDB.Set{} = set = EdgeDB.query!(pid, "select Ticket")
iex(3)> EdgeDB.Set.empty?(set)
true