Question about supabase-js client capabilities
Hey everyone, I am trying to crack the syntax for a query using the supabase-js client.
I am trying to replicate this query:
SELECT COUNT(*) as invoice_count
FROM invoices i
JOIN customers c ON i.customer_id = c.id
WHERE c.name ILIKE '%delba%';
My attempts have got me to:
The problem seems to be that the count is not factoring in the ilike condition at the end of the function. It always returns the full amount of rows in the invoice table, as if the ilike is not considered at all.
Am I doing this right? There are a number of other ways to do it, e.g. running multiple queries, counting the results after the fact, etc... But I am trying to get this right purely with the JS client to keep things from sprawling in different styles and methods.
How can we accomplish this with the js client?
I am trying to replicate this query:
SELECT COUNT(*) as invoice_count
FROM invoices i
JOIN customers c ON i.customer_id = c.id
WHERE c.name ILIKE '%delba%';
My attempts have got me to:
The problem seems to be that the count is not factoring in the ilike condition at the end of the function. It always returns the full amount of rows in the invoice table, as if the ilike is not considered at all.
Am I doing this right? There are a number of other ways to do it, e.g. running multiple queries, counting the results after the fact, etc... But I am trying to get this right purely with the JS client to keep things from sprawling in different styles and methods.
How can we accomplish this with the js client?