nickbrinser
08/16/2022, 12:55 AMgetUser()
return type is not resolving correctly.
In const {error, user} = getUser(ctx)
both error and user have a type of any.
Also if this getUser()
is called while not authenticated, user is returned as null and no error is logged.
Also made an issue in the repo.
https://github.com/supabase/auth-helpers/issues/213dmytro.eth
08/16/2022, 7:51 AMsupabase init
Then I did a schema dump from dev via pg_dump, then created a blank sql migration script via supabase migration new
and put a pgdump result there.
How can I apply those scripts to my local supabase instance?
I found how to push it to remote, but not to the localPaul AKA TDI
08/16/2022, 7:56 AMapollo79
08/16/2022, 8:22 AMapollo79
08/16/2022, 12:10 PMsupabase init
, then used supabase link
and now I wanted to use supabase db remote commit
to sync the local database with the remote one. It works, but if the command ran, I can't use supabase start
anymore, supabase db reset
is affected as well. I get this error about a fifty times:
shell
ERROR: current transaction is aborted, commands ignored until end of transaction block
emilioschepis
08/16/2022, 12:29 PMPierre_
08/16/2022, 1:11 PMdocuments
table in my database:
pgsql
create table documents (
id uuid default uuid_generate_v4() not null,
title text not null,
content text not null,
-- ... other columns
)
I would like to get all the document titles in sync with my app state. So I only need to listen for changes on the title
column, but not on the content
column (it would be a waste to download the payload each time the content
changes while I only need the title
?).
So is it possible to listen for changes on a specific column? Or is there an alternative solution?Milou
08/16/2022, 1:44 PMluke90275
08/16/2022, 3:38 PMLukas V
08/16/2022, 3:41 PMuser-content
bucket and create a folder named after uuid
of each user, I guess its the easiest way to tell who owns that folder, but would this add any complexity in the future if for example I wanted to generate new thumbnail version for each recipe image, would it make hard to find?
instead just have 1 bucket foods
and store everything there.
What is the best way to organise this sort of images?Mount Everest
08/16/2022, 4:04 PMcdedreuille
08/16/2022, 4:29 PMsupabase gen types typescript --db-url https://xxx.supabase.co
and this is the error I received:
supabase gen types typescript --db-url https://xxx.supabase.co
Error: node:internal/process/promises:279
triggerUncaughtException(err, true /* fromPromise */);
^
[UnhandledPromiseRejection: This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). The promise rejected with the reason "#<Object>".] {
code: 'ERR_UNHANDLED_REJECTION'
}
Did I do something wrong?
FYI, Docker is running and if I run supabase start it works locally as expected.
ThanksKariak
08/16/2022, 4:57 PMuseEffect(() => {
setGamesList(nfl_games)
const nflGamesSubscription = supabase
.from('nfl_games')
.on('*', (payload) => {
handleGameUpdate(payload)
})
.subscribe()
const handleGameUpdate = (gameUpdate) => {
const changedGameKey = gameUpdate.old.GameKey
const updatedGames = games.map(game => game.GameKey === changedGameKey ? gameUpdate.new : game)
setGames(updatedGames)
}
return () => {
supabase.removeSubscription(nflGamesSubscription)
}
}, [nfl_games, gamesList])
LukeB
08/16/2022, 5:00 PMomar
08/16/2022, 5:26 PMBlay3r
08/16/2022, 6:16 PMguifromrio
08/16/2022, 6:46 PM(EXISTS ( SELECT m.user_id,
m.team
FROM "Members" m
WHERE ((m.team = team) AND (m.user_id = uid()))))
Do I have to INNER JOIN?wiesson
08/16/2022, 7:01 PMexport function subscribeToInvoiceById(id: string) {
return supabaseClient
.from(`invoices_invoice:id=eq.${id}`)
.on("UPDATE", async (payload) => {
if (payload.new) {
...
My use case is that I'd like to listen to single row changes (e.g. by id) - not sure if I missed sth in the docs, but I can't find how I do it with v2-clientChrisB
08/16/2022, 7:14 PMcreate extension "uuid-ossp" with schema extensions;
also confirms this but the script select uuid_generate_v4();
fails with above error.MaxTechnics
08/16/2022, 8:26 PMjs
const { data, error } = await supabase.from('my-table').select('id-column').contains('id-column', user_data.id);
This however, does not work.
Thanks!Pierre_
08/16/2022, 9:01 PMfolders
, on which I have a few simple policies:
pgsql
create policy "Users can create folders" on folders
for insert with check (auth.uid() = user_id);
create policy "Users can view their own folders" on folders
for select using (auth.uid() = user_id);
create policy "Users can update their own folders" on folders
for update using (auth.uid() = user_id);
create policy "Users can delete their own folders" on folders
for delete using (auth.uid() = user_id);
So I created a subscription like so:
ts
const subscription = client.from("folders").on("*", (payload) => {
console.log(payload)
}).subscribe()
The websocket connection is created successfully, however when I INSERT
or UPDATE
some folders, it wasn't receiving any message (except a few times, randomly, I didn't figure out why). Yet, it was receiving the DELETE
messages.
So I disabled RLS on folders
table, and now it was working perfectly.
**Project ID**: hgqnfohuvgxsdcoymawt
I really don't have any idea on how to fix this, so I would really appreciate your help!meir
08/16/2022, 9:47 PMmeir
08/16/2022, 9:54 PMharsh singh
08/17/2022, 12:23 AMsupabase start
and I tried to run supabase gen types typescript --local > typings/db.types.ts
but I get an empty TypeScript file with zero errors.trilltrill
08/17/2022, 1:49 AMlyqht
08/17/2022, 2:15 AMZeevo
08/17/2022, 2:18 AM{"code":400,"msg":"Unsupported provider: Provider is not enabled"}
when I use supabase/ui
to log in to a Third Party Provider. When I open Studio I don't see any Configuration
options on the Default project.
Does anyone know how to enable third party providers on a locally hosted stack?Zeevo
08/17/2022, 3:39 AMhttp://localhost:3000
. Is there an easy environment variable I can set to send to http://localhost:3000/alternative-path
?rison
08/17/2022, 4:42 AMdb commit
to pull changes from the dev project, and use the new CI/CD workflow to update the production project. Is that a good way to go about it?felsey
08/17/2022, 6:31 AMconst test = async (req: any) => {
try {
// Set the Auth context of the user that called the function.
// This way your row-level-security (RLS) policies are applied.
supabaseClient.auth.setAuth(
req.headers.get("Authorization")!.replace("Bearer ", "")
);
const { data, error } = await supabaseClient.from("profiles").select("*");
console.log({ data, error });
return new Response(JSON.stringify({ data, error }), {
headers: { "Content-Type": "application/json" },
status: 200,
});
} catch (error) {
return new Response(JSON.stringify({ error: error.message }), {
headers: { "Content-Type": "application/json" },
status: 400,
});
}
};
serve(test);
console.log("hello world");