overlaps()

Only relevant for array and range columns. Match only rows where column and value have an element in common.

1const { data, error } = await supabase
2  .from('issues')
3  .select('title')
4  .overlaps('tags', ['is:closed', 'severity:high'])

Parameters#

  • columnrequired
    ColumnName

    The array or range column to filter on

  • valuerequired
    string
    |
    array

    The array or range value to filter with

      Properties
    • object
      required
      object

      No description provided.

    • stringrequired
      object

      No description provided.

Examples#

On array columns#

1create table
2  issues (
3    id int8 primary key,
4    title text,
5    tags text[]
6  );
7
8insert into
9  issues (id, title, tags)
10values
11  (1, 'Cache invalidation is not working', array['is:open', 'severity:high', 'priority:low']),
12  (2, 'Use better names', array['is:open', 'severity:low', 'priority:medium']);

On range columns#

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)');