Skip to content

Select after update or delete throws error #16

Closed
@jwelmac

Description

@jwelmac

Bug report

Describe the bug

If a select operation trails an update or delete operation to return the result an error is thrown.

To Reproduce

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

  1. Execute update or delete with a following select to return updated or deleted rows.
    Update
      await mockSupabase
                .from(table.tableName)
                .update(newData)
                .eq(emailField, user.email)
                .select();

Delete

      await mockSupabase
                .from(table.tableName)
                .delete()
                .eq(emailField, user.email)
                .select();
  1. A type error is thrown as the mock client returns the data of the row as a map not an expected list of data. Hence an error is thrown when casting the data as a list.
type '_Map<String, dynamic>' is not a subtype of type 'Iterable<dynamic>'
package:postgrest/src/postgrest_builder.dart 239:35        PostgrestBuilder._parseResponse
package:postgrest/src/postgrest_builder.dart 174:14        PostgrestBuilder._execute
===== asynchronous gap ===========================
package:postgrest/src/postgrest_builder.dart 397:24        PostgrestBuilder.then

Expected behavior

Data should be returned as expected.

Screenshots

If applicable, add screenshots to help explain your problem.

System information

  • OS: macOS

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