Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Listening Database with more than two equality conditions is not working #1035

Closed
Jaew00Shin opened this issue Sep 15, 2024 · 1 comment
Closed
Labels
bug Something isn't working realtime This issue or pull request is related to realtime

Comments

@Jaew00Shin
Copy link

Describe the bug

class SupabaseProjectDataSource {
SupabaseProjectDataSource({required Supabase supabase})
: _project = supabase.client.from('projects');

final SupabaseQueryBuilder _project;

Stream streamProject({
required String packageName,
required String platform,
}) {
var stream = _project.stream(primaryKey: ['project_id']);

stream =
stream.eq('package_name', packageName) as SupabaseStreamFilterBuilder;
stream = stream.eq('platform', platform) as SupabaseStreamFilterBuilder;

return stream.map((data) => data.first).map(ProjectRes.fromJson);

}
}

this is my data source class.

stream.eq('package_name', packageName) this option is not working.

I think it is working only for last applied equality option.

stream.eq('platform', platform) only this code is working.

How can I apply more than two filters when listening to database?

Expected behavior
A clear and concise description of what you expected to happen.

Both equality condition( stream.eq('package_name', packageName) & stream.eq('platform', platform)) should be working.

Version (please complete the following information):
On Linux/macOS
Please run dart pub deps | grep -E "supabase|gotrue|postgrest|storage_client|realtime_client|functions_client" in your project directory and paste the output here.

├── supabase_flutter 2.6.0
│ ├── supabase 2.3.0
│ │ ├── functions_client 2.3.2
│ │ ├── gotrue 2.8.4
│ │ ├── postgrest 2.1.4
│ │ ├── realtime_client 2.2.1
│ │ ├── storage_client 2.0.3

On Windows
Please run dart pub deps | findstr "supabase gotrue postgrest storage_client realtime_client functions_client" in your project directory and paste the output here.

Additional context
Add any other context about the problem here.

I think it should be working like querybuilder so that multiple query condition should be working.

@Jaew00Shin Jaew00Shin added the bug Something isn't working label Sep 15, 2024
@Vinzent03
Copy link
Collaborator

The documentation of the filter methods on .stream() states that only one filter can be applied. This is a restriction of the realtime server. So for now you can only use one filter. See #338

@Vinzent03 Vinzent03 closed this as not planned Won't fix, can't repro, duplicate, stale Sep 15, 2024
@dshukertjr dshukertjr added the realtime This issue or pull request is related to realtime label Sep 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working realtime This issue or pull request is related to realtime
Projects
None yet
Development

No branches or pull requests

3 participants