b----nessmen
08/20/2022, 11:32 PMSparK
08/21/2022, 12:42 AMKeviruchis
08/21/2022, 12:50 AMwhaley
08/21/2022, 2:00 AMlaubonghaudoi
08/21/2022, 2:14 AMtypescript
const { data, error } = await supabase
.from('messages')
.select('*, users!inner(*)');
How to count the joined users
table?MAXXtreme
08/21/2022, 2:32 AMsupabase link --project-ref PROJECT_ID
, I get an error:
sh
Error: failed to connect to `host=db.PROJECT_ID.supabase.co user=postgres database=postgres`: failed SASL auth (FATAL: SASL authentication failed (SQLSTATE 08P01))
How can I connect my local instance to my project?Milou
08/21/2022, 5:57 AMsupabase gen types typescript --local > DatabaseDefinitions.ts
In the example you use a supabase installation thats managed via supabase CLI. Is there a way to also generate types from a different, currently running local hosted installation?nahtnam
08/21/2022, 7:43 AMsupabase gen types
command fails when I provide a db-url saying that the config is missing. However I want to keep these repos separate. Is there anything we can do to retain this?Jesse
08/21/2022, 10:06 AM! Do you even Vim, bro?
08/21/2022, 1:27 PMarticles/en/1/3.json
where en
is one of many languages, 1
stands for article id and 3 represents a subheading.
Thanks in advance! 🙏leynier
08/21/2022, 3:05 PMAudrow
08/21/2022, 5:44 PMgetStaticPaths
to specify which pages are valid and getStaticProps
to load one row's data for the page. I'm having trouble getting my user data in the getStaticPaths
method, so that I can get items that are specific to that user. I'm also using row level security in my tables, so that a user can only select their data.
Any advice on how to proceed here? I'm planning to look more into @supabase/supabase-auth-helpers/nextjs
and maybe make an API route that I can use to get my current user's ID, and then I can use that with a service-level Supabase client.e.sh
08/21/2022, 5:52 PMpu0238
08/21/2022, 6:14 PMbent
08/21/2022, 6:24 PMSQL
select credit, link, collaborators.instagram, groups.id as group, theme from
groups join memberships on groups.id = memberships.group
join collaborators on collaborators.id = memberships.collaborator
where collab = 12
would be ok, and then I could use map
and reduce
to get it into this sort of structure:
js
[
{
"theme": "group 1s theme",
"collaborators": [{"credit": "my name jeff", "link": "google.com", "instagram": "jeff"}, {"credit": "asdf", "link": "google.com", "instagram": "asdf"}]
},
{
"theme": "group 2s theme",
"collaborators": [{"credit": "ulfrick", "link": "google.com", "instagram": "stormcloak69"}]
}
]
now, what's the best way to get there with supabase?
Is there even a way to get this done with only one request?
I can do this
ts
const { data, error } = await supabase.from<definitions["groups"]>("groups").select(`
theme,
collab (
collaborators (
credit
)
)`).eq('collab', id);
but then I get every person, even if they are not inside a group
and if I do
ts
const { data, error } = await supabase.from<definitions["groups"]>("groups").select(`
theme,
collaborators (
credit
)`).eq('collab', id);
collaborators
will be an array in the result, but empty.Bee
08/21/2022, 6:30 PMMonkeybanana
08/21/2022, 6:48 PMApe R Us
08/21/2022, 7:35 PMimport supabase from '$lib/db';
import { error } from '@sveltejs/kit';
export const load = async () => {
const {
data: events,
error: eventsError,
status: eventsStatus
} = await supabase.from('event').select('name, organiser, url').limit(4);
const {
data: fundraisers,
status: fundraiserStatus,
error: fundraiserError
} = await supabase.from('fundraisers').select('*');
if (events && fundraisers) {
return {
events,
fundraisers
};
}
if (eventsError || fundraiserError) {
throw error(404, `Events: ${eventsError?.message}, Fundraiser: ${fundraiserError?.message}`);
}
};
Fainaru
08/21/2022, 9:09 PMFyris
08/21/2022, 9:19 PMsupabase.auth.signOut()
request is sent, however token inside local storage is not removed. Due to that supabase.auth.user()
returns valid user object and not null.
I inspected signOut
method and it is supposed to remove item in local storage with session, however this is not done.
I need to to it manually by myself with localStorage.removeItem(STORAGE_KEY)
.
Had anybody seen similar problem like this?
Here's code I have used:
const handleSignOut = async () => {
await getClient().auth.signOut();
localStorage.removeItem(STORAGE_KEY); // this is mandatory, otherwise signing out doesn't work
setUser(null)
}
samwoolerton
08/21/2022, 10:15 PMsupabase start
because running migrations throws with function auth.jwt() does not exist
.
Is there a setting I can change or some step I've missed?
I've opened an issue on GitHub here: https://github.com/supabase/postgres/issues/277harsh singh
08/22/2022, 12:52 AMharsh singh
08/22/2022, 1:58 AMkevindmoore
08/22/2022, 3:22 AMfinal data = await client.from(tableName).insert(tableData);
stha_ashesh
08/22/2022, 3:25 AMFainaru
08/22/2022, 5:15 AMdaud18
08/22/2022, 6:43 AMMrZe0n
08/22/2022, 7:57 AMraae (queen.raae.codes)
08/22/2022, 12:44 PMimport { createClient } from "@supabase/supabase-js";
import fetch from "node-fetch";
const supabase = createClient(supabaseUrl, supabaseAnonKey, {
fetch: (...args) => fetch(...args),
});
const userResult = await supabase.auth.getUser(
req.body.accessToken
);
I get:
Right-hand side of 'instanceof' is not an object
TypeError: Right-hand side of 'instanceof' is not an object
- fetch.js?:23 eval
[.]/[@supabase]/gotrue-js/dist/module/lib/fetch.js?:23:17
- Generator.next
This does not happen if I switch to Node 18. Or if I switch back to version 1 of supabase and use supabase.auth.api.getUser
Is there anything I could do to get it to work on Node16?Jaaneek
08/22/2022, 12:59 PM