View Source EdgeDB.Set (EdgeDB v0.7.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, client} = EdgeDB.start_link()
iex(2)> set =
...(2)>  EdgeDB.query!(client, """
...(2)>   select schema::ObjectType{
...(2)>     name
...(2)>   }
...(2)>   filter .name IN {'std::BaseObject', 'std::Object', 'std::FreeObject'}
...(2)>   order by .name
...(2)>  """)
iex(3)> set
#EdgeDB.Set<{#EdgeDB.Object<name := "std::BaseObject">, #EdgeDB.Object<name := "std::FreeObject">, #EdgeDB.Object<name := "std::Object">}>

Summary

Types

t()

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

Functions

Check if set is empty.

Types

@opaque t()

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

Functions

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

Check if set is empty.

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