Closed
Description
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:
- 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();
- 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