View Source EdgeDB.Range (EdgeDB v0.4.0)

A value representing some interval of values.

iex(1)> {:ok, pid} = EdgeDB.start_link()
iex(2)> EdgeDB.query_required_single!(pid, "select range(1, 10)")
#EdgeDB.Range<[1, 10)>

Link to this section Summary

Types

Options for EdgeDB.Range.new/3 function.

t()

A value representing some interval of values.

A value representing some interval of values.

Functions

Create an empty range.

Create new range.

Link to this section Types

@type creation_option() ::
  {:inc_lower, boolean()} | {:inc_upper, boolean()} | {:empty, boolean()}

Options for EdgeDB.Range.new/3 function.

Supported options:

  • :inc_lower - flag whether the created range should strictly include the lower boundary.
  • :inc_upper - flag whether the created range should strictly include the upper boundary.
  • :empty - flag to create an empty range.
@type t() :: t(term())

A value representing some interval of values.

@type t(value) :: %EdgeDB.Range{
  inc_lower: boolean(),
  inc_upper: boolean(),
  is_empty: boolean(),
  lower: value | nil,
  upper: value | nil
}

A value representing some interval of values.

Fields:

  • :lower - data for the lower range boundary.
  • :upper - data for the upper range boundary.
  • :inc_lower - flag whether the range should strictly include the lower boundary.
  • :inc_upper - flag whether the range should strictly include the upper boundary.
  • :is_empty - flag for an empty range.

Link to this section Functions

@spec empty() :: t()

Create an empty range.

iex(1)> EdgeDB.Range.empty()
#EdgeDB.Range<empty>
Link to this function

new(lower, upper, opts \\ [])

View Source
@spec new(value, value, [creation_option()]) :: t(value) when value: term()

Create new range.

iex(1)> EdgeDB.Range.new(1.1, 3.3, inc_upper: true)
#EdgeDB.Range<[1.1, 3.3]>