Bruno Nogueira
10/25/2022, 1:37 AMhttp(('DELETE', ...
Gives the "illegal HTTP method" error.
http_delete('https://...
Gives the "function http_delete(unknown, unknown, json) does not exist" error.
Is that anyone facing the same issue?a99111cc042b477e9f22eafe7
10/25/2022, 7:24 AMDies.Irae
10/25/2022, 8:07 AM'new row violates row-level security policy for table "objects"'
on image upload, even though I've set up the policies on the image bucketjanosch.hrm
10/25/2022, 8:15 AMsupabase start
supabase gen types typescript --local > lib/database.types.ts
The question is: How do I get this to use the types for tables in my remote database? When I ran the commands as seen above, it generated types for a new local database.
I haven't found a way to specificy which db I want to generate the types for in the Supabase docs.draco
10/25/2022, 8:44 AMPeople
id: 1, name: Steve , age: 43
id: 2, name: Janet, age:25
Interests
id: 1, category: hiking, people: [1,2]
So given this kind of structure, I am trying to figure out how to do a select from interests, but have the return data include the full information of each person in the list of people id instead of just the id themselves..
I know that you can use a join to accomplish this, but have had no success when trying to build a sql query using the dashboard or using the js library. It’s clearly user error on my part as I am still learning how to structure queries so any pointers would help.
I am trying to avoid the alternative of making multiple calls for each person id after I select the interest row since that seems inefficient.Daddymilker4000
10/25/2022, 9:12 AMid
)
.eq("id", user.id);
store.dispatch(writeUserData(data));
return data;
}
return {
props: {
data: await getData(),
},
};
}
}
);
`
Any ideas how I can achieve the same functionality with withPageAuth()?
export const getServerSideProps = withPageAuth({
redirectTo: '/foo',
async getServerSideProps (ctx, supabase) {
// Access the user object
const {
data: { user }
} = await supabase.auth.getUser()
return { props: { id: user?.id } }
}
})
a99111cc042b477e9f22eafe7
10/25/2022, 9:13 AMflapili (FR, bad EN)
10/25/2022, 10:31 AMAmr
10/25/2022, 11:44 AM[1, 2]
There's an existing row that has [1, 5]
I want to check if 1
exist in [1, 5]
I tried this code:
js
await supabase.from('reservations')
.select()
.eq('departureTripId', departureTripId)
.containedBy('departureSeats', departureSeats);
But it doesn't return anything resulting in allowing for duplicate seats!Amr
10/25/2022, 12:02 PMProperty 'signInWithPasswordless' does not exist on type 'SupabaseAuthClient'. Did you mean 'signInWithPassword'?
I've updated to "@supabase/supabase-js": "^2.0.4"
cdedreuille
10/25/2022, 12:12 PMJSON.stringify()
from the body when invoking the function.
Invoke before
await supabaseClient.functions.invoke("media-upload", {
body: JSON.stringify({
path: fileName,
}),
});
Invoke after
await supabaseClient.functions.invoke("media-upload", {
body: {
path: fileName,
},
});
In my function:
const corsHeaders = {
"Access-Control-Allow-Origin": "*",
"Access-Control-Allow-Headers": "authorization, x-client-info, apikey",
};
serve(async (req) => {
if (req.method === "OPTIONS") {
return new Response("ok", { headers: corsHeaders });
}
try {
...
} catch (error) {
...
}
});
Any idea why if I remove JSON.stringify()
I get a CORS error? It seems that now we have to remove it with v2.MDobs
10/25/2022, 12:13 PMgame_rooms
where the row has a column named nickname
with a value of x
const gameRooms = supabase
.from(`game_rooms:nickname=eq.${gameRoomNickname}`)
.on("*", (payload) => {
console.log("Change received!", payload)
})
.subscribe()
this throws an error though, although it follows the example from the API page. What seems to be wrong with it?FunHellion
10/25/2022, 12:19 PMsql
create trigger role_permissions_update_user_claims after delete or insert on role_permissions
for each row execute
procedure update_claims_role_permissions_update(role)
Could the reason be that I am still using supabase.js v1
or might there be another reason for this.
I'll gladly provide more information if needed.
Thanks in advance,
BramMarcus Arnfast
10/25/2022, 1:27 PMitisnajim
10/25/2022, 1:51 PM[error] Postgrex.Protocol (#PID<0.235.0>) failed to connect: ** (Postgrex.Error) FATAL 42501 (insufficient_privilege) permission denied to set parameter "pg_stat_statements.track"
any idea of how to resolve ?flapili (FR, bad EN)
10/25/2022, 3:17 PMsql
drop function if exists tempo(text);
create
or replace function tempo(url text) returns integer language plpgsql as $$
declare
res_status integer;
trash int;
begin
SELECT 1 into trash FROM http_set_curlopt('CURLOPT_TIMEOUT_MS', '10000');
SELECT 1 into trash FROM http_set_curlopt('CURLOPT_CONNECTTIMEOUT', '10000');
SELECT status INTO res_status FROM http_get('http://google.fr');
RETURN res_status;
end;
$$;
MaGnezij
10/25/2022, 3:18 PMpatrick
10/25/2022, 3:30 PMlibovness
10/25/2022, 4:09 PMconfig_wizard
10/25/2022, 4:15 PMbrassotron
10/25/2022, 4:43 PMpatrick
10/25/2022, 4:55 PMVWL Tobias Hassebrock
10/25/2022, 5:02 PMeo me
10/25/2022, 7:05 PMperry
10/25/2022, 7:21 PMUnknown Member
10/25/2022, 8:20 PMSmardrengr
10/25/2022, 8:41 PMSUPABASE_URL
and SUPABASE_ANON_KEY
.caseycrogers
10/25/2022, 9:07 PMsignInWithProvider
, it navigates to a website instead of the app. Is there a way to get Supabase to open the app instead?
No one is ever signed in on the website so if they have to sign in to their Google/Twitter/FB account then half the point of using a sign in provider is kind of defeated...balabanshik
10/25/2022, 10:51 PMDatasource "db": PostgreSQL database "postgres", schema "public" at "db.jbpbrlnjcocobepnwhst.supabase.co:5432"
Error: P1001: Can't reach database server at `db.jbpbrlnjcocobepnwhst.supabase.co`:`5432`
(This is a new blank DB spun up specifically to test my connection, so not masking it)
Other data points:
1. I can go and see out DBs in the web UI
2. The app connects to a local Postgres just fine
3. Pinging the url times out
4. Trying with different DBs doesn't change the result
5. None of the usual fidgeting approaches (change Node version, restart, full reclone/rebuild etc) help either