View Source EdgeDB.Range (EdgeDB v0.6.1)

A value representing some interval of values.

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

Link to this section Summary

Types

Options for EdgeDB.Range.new/3 function.

t()

A value of value/0 type representing some interval of values.

A value of value/0 type representing some interval of values.

A type that is acceptable by EdgeDB ranges.

Functions

Create an empty range.

Create new range.

Link to this section Types

Link to this type

creation_option()

View Source (since 0.4.0)
@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(value())

A value of value/0 type representing some interval of values.

Link to this type

t(value)

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

A value of value/0 type 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.
@type value() ::
  integer()
  | float()
  | Decimal.t()
  | DateTime.t()
  | NaiveDateTime.t()
  | Date.t()

A type that is acceptable by EdgeDB ranges.

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 (since 0.4.0)
@spec new(value | nil, value | nil, [creation_option()]) :: t(value)
when value: value()

Create new range.

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