Puru
10/18/2021, 4:25 PMsilentworks
10/18/2021, 5:26 PMulisses
10/19/2021, 1:22 PMSayan Nath
10/19/2021, 3:10 PMlet { data, error } = await supabase_connect
.from("Users")
.select("name, username, verified, image_url")
.ilike("name", `%${req.body.name}%`)
.range(req.body.skip, req.body.limit);
Tried .textSearch()
but it didn't worked out what actually I wanted.khacvy
10/19/2021, 4:35 PMmikebarkmin
10/19/2021, 5:08 PMSayan Nath
10/19/2021, 5:22 PMSa
the people with the beginning of Sa
in name or surname will appear but if anyone searches at
then in the above code I am also appearingsilentworks
10/19/2021, 5:23 PMchipilov
10/19/2021, 5:36 PMmikebarkmin
10/19/2021, 5:49 PMlarryM
10/20/2021, 3:16 AMjocarrito
10/20/2021, 3:41 AMjocarrito
10/20/2021, 3:41 AMconst { data: users, error, status } = await supabase
.from<definitions['users']>('users')
.select('*')
mikebarkmin
10/20/2021, 5:42 AMmikebarkmin
10/20/2021, 11:02 AMMattias
10/20/2021, 12:39 PMpg
! Would you mind sharing an example of a connection with Supabase. I keep getting Error: getaddrinfo ENOTFOUND https://lotsofletters.supabase.co
My code:
js
const pool = new Pool({
user: 'postgres',
host: import.meta.env.VITE_SUPABASE_URL,
database: 'postgres',
password: import.meta.env.VITE_SUPABASE_ANON_KEY,
port: 5432,
});
pool.query('SELECT NOW()', (err, res) => {
console.log(err, res)
pool.end()
})
Sayan Nath
10/20/2021, 12:58 PMSELECT * FROM "Users" WHERE name LIKE 'Na%' OR name LIKE '%Na' OR name LIKE '%Na%'
0xhjohnson
10/20/2021, 1:03 PM0xhjohnson
10/20/2021, 1:07 PMRB_Gaura
10/21/2021, 4:35 AMsilentworks
10/21/2021, 11:32 AMjonny
10/21/2021, 6:32 PMM1K3
10/21/2021, 8:15 PMstibbs
10/22/2021, 4:44 AMts
const { data, error, count } = await supabase
.from('jobs')
.select('id', { count: 'exact', head: true })
.gt('valid_until', 'now()')
.neq('closed', 'true');
bash
invalid json response body at https://cdylbjsfwtolxghadbnk.supabase.co/rest/v1/jobs?select=id&valid_until=gt.now%28%29&closed=neq.true reason: Unexpected end of JSON input
FetchError: invalid json response body at https://cdylbjsfwtolxghadbnk.supabase.co/rest/v1/jobs?select=id&valid_until=gt.now%28%29&closed=neq.true reason: Unexpected end of JSON input
at C:\Users\matt\proj\bread\node_modules\node-fetch\lib\index.js:272:32
at processTicksAndRejections (internal/process/task_queues.js:95:5)
stibbs
10/22/2021, 4:46 AMjason-lynx
10/22/2021, 5:51 AM.neq('closed', 'true');
with .is('closed', false)
?stibbs
10/22/2021, 6:39 AMstibbs
10/22/2021, 7:10 AMstibbs
10/22/2021, 7:11 AMts
<script context="module" lang="ts">
import type { Load } from '@sveltejs/kit';
export const load: Load = async ({ fetch }) => {
const countRes = await fetch('/api/count_jobs');
if (countRes.ok) {
const count = await countRes.json();
return { props: { jobCount: count } };
}
return {
status: countRes.status,
error: new Error(`Failed to load job count`)
};
};
</script>
Same behavior occurs if I try different ways of executing the query such as via an rpc...
sql
create or replace function count_open_jobs(out job_count integer)
returns integer
language plpgsql
as $$
begin
select count(*) into job_count
from public.jobs
where valid_until > now()
and closed = false;
end; $$
stibbs
10/22/2021, 7:12 AM