Bicijay
04/02/2022, 5:37 PMjoshcowan25
04/02/2022, 7:17 PMlaznic
04/02/2022, 7:35 PMDanMossa
04/02/2022, 9:28 PMThe Noah
04/03/2022, 1:08 AMsrc/hooks.ts
. The user data is correctly fetched using supabase.auth.api.getUser(accessToken)
.
The issue comes in when I try to query my profiles
table. I query it by the user's id
. The profiles
table id
column is related to the auth.users
id
column. Everything properly matches, but the query returns nothing. This is where things start getting strange. I have a profiles.ts
file with helper functions which is what I use to call to Supabase. If I edit this file, SvelteKit hot reloads and the function then returns data as it should. However, just reloading the page does not make it return properly. As a sanity check I made it return the entire table instead of just the correct user, and it just returns an empty array.
I don't think I've ever run into an error quite like this, any help would be much appreciated.jdgamble555
04/03/2022, 1:20 AMexists
function like select exists(select 1 from contact where id=12)
in supabase?samΓΌel
04/03/2022, 1:22 AMpg_graphql
functionality up over the last two days, but for some reason tables are not registering in the gql schema.
https://github.com/supabase/supabase/discussions/6262
I've detailed most of my current troubleshooting steps here, but thought it might be worth checking here as well.
1. Fresh project with pg_graphql
enabled.
2. Table countries
created via the dashboard on the public
schema.
3. No countries
showing in gql schema.
json
{
"data": {
"__schema": {
"queryType": {
"name": "Query"
},
"directives": [],
"mutationType": null,
"subscriptionType": null
}
},
"errors": []
}
jdgamble555
04/03/2022, 3:16 AMak4zh
04/03/2022, 4:14 AMbash
keeplearning@pop-os:~/CodeProjects/test-edge$ supabase functions deploy hello-world
Error: Platform linux/386 is currently unsupported for Functions.
Unable to deploy edge functions.Ape R Us
04/03/2022, 7:20 AMexport const user = readable(null, (set) => {
set(supabase.auth.user());
const unsubscribe = supabase.auth.onAuthStateChange((_, session) => {
session ? set(session.user) : set(null);
});
return () => {
unsubscribe.data.unsubscribe();
};
});
hero76
04/03/2022, 8:11 AMhero76
04/03/2022, 8:12 AMhero76
04/03/2022, 8:13 AMNeedle
04/03/2022, 11:22 AM/title
command!
We have solved your problem?
Click the button below to archive it.Needle
04/03/2022, 1:31 PM/title
command!
We have solved your problem?
Click the button below to archive it.GuardianXT705
04/03/2022, 2:04 PMpocin
04/03/2022, 2:43 PMpsql -f schema.sql
against freshly started supabase instance
2.2) run a supabase db changes
with 2.1 against a supabase with all existing migrations to get a diff
2.3) (check diff + update where necessary) apply diff to production to end up with a same state as in 2.1
currently when you run supabase start
it seems to run all existing migrations so i can't easily execute 2.1) and i have to essentially hand write my migrations.
Or is the intended workflow the other way around and i should not maintain a hand written schema.sql
but instead do pg_dump
of the final database to get it? But this would still mean i have to hand write migrations or do manual changes to the database (i prefer to do it in code).Needle
04/03/2022, 3:02 PM/title
command!
We have solved your problem?
Click the button below to archive it.Aruzo
04/03/2022, 3:27 PMNeedle
04/03/2022, 3:49 PM/title
command!
We have solved your problem?
Click the button below to archive it.Yeehawlerz101
04/03/2022, 3:59 PMjs
// @ts-nocheck
const supabaseUrl = "XXX"
const supabaseAnonKey = "XXX"
// Create a single supabase client for interacting with your database
export const supabase = createClient(supabaseUrl, supabaseAnonKey);
note the XXX is where my url and key is. any help would be huge!
I also did npm ci
to clean install my modules incase that was the issueak4zh
04/03/2022, 5:31 PMname
it applies a sorting always on name column for no reason, I have to always remove filter every-time I refresh page or open the table viewer again to be able to see my data sorted by id which should be the default.pcj127
04/03/2022, 7:16 PMjs
await client.rpc<Foo>('create_foo', { name }).select().single();
function:
sql
CREATE OR REPLACE FUNCTION create_foo(
"name" text
)
RETURNS setof foo
...
But getting this following error:
sh
404 Not Found: Could not find the public.create_foo() function or the public.create_foo function with a single unnamed json or jsonb parameter in the schema cache (undefined)
Any idea what I could be missing?Manuel Coffin
04/03/2022, 8:28 PMCan't reach database server at `db.<my-id>.supabase.co`:`5432`
Please make sure your database server is running at `db.<my-id>.supabase.co`:`5432`.
I saw some other people getting this, but didn't find a solution... Nothing has changed in my db configurationsbr
04/03/2022, 8:58 PMuseEffect(() => {
supabaseClient.auth.onAuthStateChange((event, session) => {
if (event === "SIGNED_IN") {
supabaseClient.auth.api
.getUser(session.access_token)
.then(({ user, error }) => {
if (user) {
setUser(user);
}
});
} else if (event === "SIGNED_OUT") {
setUser(null);
}
});
}, []);
Duckstroyer
04/04/2022, 1:27 AMNeedle
04/04/2022, 1:29 AM/title
command!
We have solved your problem?
Click the button below to archive it.jjaimealeman
04/04/2022, 2:35 AMdata.db
from my local instance into data.sql
.
I wish to import that file into Supabase but not sure how to?! π
I ran
> sqlite3 data.db
SQLite version 3.38.2 2022-03-26 13:51:10
Enter ".help" for usage hints.
sqlite> .output data.sql
sqlite> .dump
sqlite> .exit
then
> sqlite3 data.db`
sqlite> .output data_structure.sql
sqlite> .schema
sqlite> .quit
I now have data.sql
with all data and data_structure.sql
π
Just don't know where to go from there. Been Googling for a while and most solutions seem to point to Rails and Gems πsbr
04/04/2022, 4:30 AMauth-helpers
for NextJS and not sure if my issue is a bug or expected behavior.
The app is a simple todo list with authentication. But once I'm signed-in and if I sign out in another tab, I'm still able to write to the table by creating new todos in the first tab. Is this expected?