Deleted User
10/09/2021, 10:16 AM@supabase/supabase-js
just using a PostgreSQL? In other words, is there a way to use .from().select().eq()
syntax with just a PostgreSQL database? Thank yousilentworks
10/09/2021, 10:58 AMuser
10/09/2021, 11:17 AMmlloydw
10/09/2021, 11:57 PMmlloydw
10/10/2021, 12:07 AMBlindWebDev
10/10/2021, 7:46 AMconst [finalUser, setUser] = Recoil.useRecoilState(atomUser);
async function setUserGlobally(user) {
console.dir(user);
if (!user) {
console.log("no user");
setUser(null);
return;
}
const res = await callApi("/api/users", "post", user);
const data = {
...user,
dbID: res.id,
customerid: res.customerid,
subscribed: res.subscribed,
};
//update recoil state here.
setUser(data);
}
React.useEffect(() => {
setUserGlobally(supabase.auth.user());
}, []);
supabase.auth.onAuthStateChange((event, session) => {
console.log(`on auth state change`);
setUserGlobally(session.user);
});
BlindWebDev
10/10/2021, 9:08 AMBlindWebDev
10/10/2021, 10:41 AMSETY
10/10/2021, 2:23 PM0xhjohnson
10/10/2021, 11:44 PMjason-lynx
10/11/2021, 2:32 AMSETY
10/11/2021, 2:34 AMSETY
10/11/2021, 2:34 AMjason-lynx
10/11/2021, 2:35 AMjason-lynx
10/11/2021, 2:35 AMjason-lynx
10/11/2021, 2:37 AMINSERT INTO tbl(col_with_default) VALUES(DEFAULT)
jason-lynx
10/11/2021, 2:49 AMSETY
10/11/2021, 3:44 AMSETY
10/11/2021, 3:44 AMSETY
10/11/2021, 3:44 AMjason-lynx
10/11/2021, 4:45 AMPartial<YOUR_DB_TYPE>
, or Omit<YOUR_DB_TYPE, PK>
manubaun
10/11/2021, 8:18 PMts
const client = new SupabaseClient(url, key)
client.form('Author').on('*', (payload)=>console.log(payload)
But when I use the @supabase/realtime-js
and subscribe directly via the RealtimeClient like this, it works:
ts
const socket = new RealtimeClient(supabaseURLRealtime);
socket.connect();
const DatabaseListener = socket.channel('realtime:*');
DatabaseListener.subscribe()
.receive('ok', () => console.log('DatabaseListener connected '))
.receive('error', () => console.log('Failed'))
.receive('timeout', () => console.log('Waiting...'));
DatabaseListener.on('*', (change: ChangeResponse<Author>) => {
console.log('Change received on DatabaseListener', change.record);
});
I was debugging it a bit and found out, that the supabaseClient connects to the host:8000/realtime/v1/websocket
endpoint, while with the realtimeClient I connected to host:4000/socket
. No I am not sure, if that is actually the same endpoint. But the host:8000/realtime/v1/websocket
just does not work.
Any Ideas?
--- edit ---
1. Btw. the websocket connection is working.
2. I also see the Subscription, when calling getSubscriptions()
, but it has state: closedmanubaun
10/11/2021, 8:29 PMmanubaun
10/11/2021, 8:34 PM.subscribe()
now its workingjon
10/11/2021, 11:31 PMjon
10/11/2021, 11:32 PMconst baseQuery = supabase
.from('jobs')
.select(
`
id,
date_posted,
organization_id (
name,
domain,
description_short,
headcount
),
permalink,
title,
description
`,
)
.gt('date_posted', getLastWeek().toUTCString())
.filter('organizations.name', 'neq', 'Mixpanel');
Results always include "Mixpanel". What am I missing here?SETY
10/12/2021, 12:41 AMjon
10/12/2021, 1:22 AMCould not find a relationship between jobs and organization in the schema cache
jon
10/12/2021, 1:22 AMorganizations
in the select but still same result