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

[FEAT]: Supabase Data Provider should filter array column by array #5902

Open
alicanerdurmaz opened this issue Apr 30, 2024 · 5 comments · May be fixed by #5922
Open

[FEAT]: Supabase Data Provider should filter array column by array #5902

alicanerdurmaz opened this issue Apr 30, 2024 · 5 comments · May be fixed by #5922
Assignees
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@alicanerdurmaz
Copy link
Member

alicanerdurmaz commented Apr 30, 2024

Is your feature request related to a problem? Please describe.

I want to filter the array column with an array in Supabase.
For example, I have the genres column and it has this data:

  • [Comedy, Music, Horror]
  • [Comedy]
  • [Drama]

and I want to filter with this value:

  • [Comedy, Music]

but Refine doesn't have a CrudFilter to support it.

Describe the thing to improve

We can add ina and nina CrudFilter and map to query.contains in Supabase data provider to support this case.

@alicanerdurmaz alicanerdurmaz added enhancement New feature or request good first issue Good for newcomers labels Apr 30, 2024
@issa012
Copy link
Contributor

issa012 commented Apr 30, 2024

Hello! Please assign this to me, I would be happy to help.

@alicanerdurmaz
Copy link
Member Author

Hello @issa012, I assigned this task to you. Thank you for improving Refine 🙌

@issa012
Copy link
Contributor

issa012 commented May 4, 2024

Hi! 2 questions.

  1. I am adding ina and nina directly to CrudFilter. Is this okay, or should I try to create custom type and extend CrudFilter?
  2. How should I go about writing tests? The Supabase database doesn't contain any tables that have array values. I would like to add some fields or create new tables. It seems it is not possible to connect with only URL and KEY.

@alicanerdurmaz
Copy link
Member Author

Hi! 2 questions.

  1. I am adding ina and nina directly to CrudFilter. Is this okay, or should I try to create custom type and extend CrudFilter?
  2. How should I go about writing tests? The Supabase database doesn't contain any tables that have array values. I would like to add some fields or create new tables. It seems it is not possible to connect with only URL and KEY.
  1. Yes, we can add ina and nina to CrudFilter.

  2. In supabase package all tests are mocked. In supabase package, all tests are mocked. I think the ideal scenario for testing this feature would be like this:

  3. Create a new supabase project with your needs and connect the tests supabaseClient to that project from here:

  4. Add new test cases and run tests. you can get mock results on CLI when you uncomment this line

  5. copy mocks to your mock file, comment nock.recorder.rec() again

@jim-knight
Copy link

Thanks for this guys, literally just ran into this issue today so would love to see this implemented.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants