rangeAdjacent()

Only relevant for range columns. Match only rows where column is mutually exclusive to range and there can be no element between the two ranges.

1const { data, error } = await supabase
2  .from('reservations')
3  .select()
4  .rangeAdjacent('during', '[2000-01-01 12:00, 2000-01-01 13:00)')

Parameters#

  • columnrequired
    ColumnName

    The range column to filter on

  • rangerequired
    string

    The range to filter with

Examples#

With select()#

Postgres supports a number of range types. You can filter on range columns using the string representation of range values.

1create table
2  reservations (
3    id int8 primary key,
4    room_name text,
5    during tsrange
6  );
7
8insert into
9  reservations (id, room_name, during)
10values
11  (1, 'Emerald', '[2000-01-01 13:00, 2000-01-01 15:00)'),
12  (2, 'Topaz', '[2000-01-02 09:00, 2000-01-02 10:00)');