refinedev/refine

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

alicanerdurmaz opened this issue · 5 comments

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.

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

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

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.

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

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