As per: https://supabase.com/docs/guides/realtime/extensions/postgres-changes#in
the in filter must follow the pattern of:
id=in.(1,2,3)
Currently, j-supabase is subscribing using the pattern:
id=in.1,2,3
passing in a string of (1,2,3) to the in() function properly subscribes and follows changes, however it then breaks the supabase/postgrest-js as follows:
Uncaught TypeError: values.map is not a function
at PostgrestFilterBuilder.in (PostgrestFilterBuilder.ts:223:8)
at initialize (realtime.ts:42:45)
at realtime.ts:88:25
https://github.com/jdgamble555/j-supabase/blob/master/src/lib/realtime.ts#L32
const filterString = `${field}=${filterName}.${value}`;
needs to account for the in filter.
Perhaps something like:
let filterString = `${field}=${filterName}.${value}`;
if (filterName === 'in') {
if (!Array.isArray(value)) throw new Error('Filter value must be an array when using "in"')
filterString = `${field}=${filterName}.(${value.join(',')})`
}
As per: https://supabase.com/docs/guides/realtime/extensions/postgres-changes#in
the
infilter must follow the pattern of:id=in.(1,2,3)Currently, j-supabase is subscribing using the pattern:
id=in.1,2,3passing in a string of
(1,2,3)to thein()function properly subscribes and follows changes, however it then breaks the supabase/postgrest-js as follows:https://github.com/jdgamble555/j-supabase/blob/master/src/lib/realtime.ts#L32
needs to account for the in filter.
Perhaps something like: