sumchans
08/24/2021, 2:08 AMsumchans
08/24/2021, 2:08 AMjason-lynx
08/24/2021, 2:12 AM['%91960000000', '%7780000000', ...]
), then
const { data, error } = await supabase
.from('users')
.select('phone_number')
.in('phone_number', @contacts)
jason-lynx
08/24/2021, 2:15 AMsumchans
08/24/2021, 5:06 PMCREATE FUNCTION users_with_matching_phone_number(contacts text[]) RETURNS TABLE(phone_number text) as $$
SELECT * FROM users WHERE phone_number LIKE ANY(contacts);
$$ language sql;
silentworks
08/24/2021, 5:08 PMsumchans
08/24/2021, 5:10 PMsumchans
08/24/2021, 5:11 PMsilentworks
08/24/2021, 5:17 PMsumchans
08/24/2021, 6:18 PMPeanut
08/25/2021, 1:05 AMsoedirgo
08/25/2021, 4:27 AMcount
overrides that setting)Peanut
08/25/2021, 4:52 AMcount
to estimated
and I get 1000 (when I know it's more - over 1600)soedirgo
08/25/2021, 5:04 AMcount: 'exact'
?Peanut
08/25/2021, 8:34 AMsoedirgo
08/25/2021, 8:54 AMestimated
uses the Postgres stats collector so the number tends to be offPeanut
08/25/2021, 9:00 AMPeanut
08/25/2021, 9:10 AMWaldemar
08/25/2021, 10:44 AMDROP SCHEMA public CASCADE;
CREATE SCHEMA public;
GRANT ALL ON SCHEMA public TO postgres;
GRANT ALL ON SCHEMA public TO public;
(Background: I'm coding a tool that migrates an Airtable base to Postgres / Supabase and need to "reset" the target Supabase tables frequently. So it is a dev/test project at the moment, but once I get the migration right, I want to continue to develop the live app on top of it, so I'm a bit paranoid it will mess up something in long run)soedirgo
08/25/2021, 11:05 AMuser
08/25/2021, 1:52 PMHorseShoe
08/25/2021, 3:12 PMHorseShoe
08/25/2021, 3:13 PMHorseShoe
08/25/2021, 3:13 PMsilentworks
08/25/2021, 5:01 PM.rpc
methodsilentworks
08/25/2021, 5:02 PMHorseShoe
08/25/2021, 5:22 PMHorseShoe
08/25/2021, 5:22 PMHorseShoe
08/25/2021, 5:23 PMcreate policy blah blah using ( msg.user = auth.uid() AND msg.type = text )
HorseShoe
08/25/2021, 5:23 PM