Skip to content

fix: error thrown if row selected with filter in empty table #21

@jwelmac

Description

@jwelmac

Bug report

Describe the bug

Performing a select operation with a filter after deleting the last row in a table results in an error.

To Reproduce

Steps to reproduce the behavior, please provide code snippets or a repository:

  1. Insert an item
      // Insert an item
      await mockSupabase
          .from('posts')
          .insert({'id': 1, 'title': 'To be deleted'});
  1. Delete the item
      await mockSupabase.from('posts').delete().eq('id', 1);
  1. Attempt to select an item with a filter
      final posts = await mockSupabase.from('posts').select().eq('id', 1);
  1. Bad state no element error thrown when setting up FilterParser.parseFilter since the returning rows list is empty. See line 549.

Expected behavior

An empty array should be returned if the returningRows list is empty when trying to apply filters.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions