Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion lib/src/utils/filter_parser.dart
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,11 @@ class FilterParser {
return (row) => row[columnName] == null;
} else if (postrestFilter.startsWith('in.')) {
final value = postrestFilter.substring(3);
final values = value.substring(1, value.length - 1).split(',');
final values =
value.substring(1, value.length - 1)
.split(',')
.map((e) => e.replaceAll(RegExp(r'^"|"$'), ''))
.toList();
return (row) => values.contains(row[columnName].toString());
} else if (postrestFilter.startsWith('cs.')) {
final value = postrestFilter.substring(3);
Expand Down
4 changes: 4 additions & 0 deletions test/mock_supabase_http_client_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -380,6 +380,10 @@ void main() {
final posts =
await mockSupabase.from('posts').select().inFilter('id', [1, 2]);
expect(posts.length, 2);

final strPosts =
await mockSupabase.from('posts').select().inFilter('title', ["First post"]);
expect(strPosts.length, 1);
});
group('Not filters', () {
setUp(() async {
Expand Down