Kellen Mace
03/16/2023, 7:01 PMsupabase db dump --db-url "postgresql://postgres:MYPASSWORD@db.krpyriciwjyezbzvkmjo.supabase.co:5432/postgres" -f schema.sql --debug
(replacing MYPASSWORD
with the actual password for the postgres user)
...I get this:
Dumping schemas from remote database...
Error: Error running pg_dump on remote database: Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?
Two questions:
1. When the docs say to use the "database URL" is this what they mean? Am I supposed to use the full postgresql:// (etc.)
connection string?
2. What am I doing wrong? Why can't I connect to the remote database?
I have the latest versions of psql, pg_dump and the supabase CLI installed, and I've been able to export my database in the past using the old method in the docs of setting the postgres user as a SUPERUSER, then running a pg_dump command to dump the database.titongo
03/16/2023, 7:27 PMMindrest
03/16/2023, 8:30 PM.removeChannel(someChannel)
What's then myChannel.unsubscribe
used for then? in which cases is better to use unsubscribe
instead of the other option?Creix
03/16/2023, 8:42 PMVik
03/16/2023, 9:37 PMcodecoolkid
03/16/2023, 9:49 PMshane
03/16/2023, 10:33 PMAlanK
03/16/2023, 10:54 PMraise log 'var_where_clause = % ', var_where_clause;
When I go to Logs/Postgres there is 'No Results' - like no logging at all.
Have I missed something? Or have I got it wrong?pan_cheta
03/16/2023, 11:08 PMSmoothBot
03/16/2023, 11:28 PMlouis77
03/16/2023, 11:47 PMVik
03/17/2023, 1:02 AMVince
03/17/2023, 1:03 AMphotos-bucket
and I wrote the following logic:
let { error: uploadError } = await supabase.storage
.from('photos-bucket')
.upload(filePath, file, { upsert: true });
But I get the error that it cannot read properties of undefined? It looks like supabase.storage
is undefined but why is this the case?Bigmancozmo
03/17/2023, 1:54 AMjs
const { error } = await supabase
.from('countries')
.update({ name: 'Australia' })
.eq('id', 1)
and I'm confused. Is .update updating the data, or telling it what data to update? Same with .eq. What I want to do is change this (first image) to this (second image) with my code, but I don't understand how to.
Also, sorry if I put this in the wrong tags, I don't really understand much.KitKat
03/17/2023, 6:05 AMmoxdisboss
03/17/2023, 6:33 AMjoni.giuro
03/17/2023, 8:53 AM0xAA
03/17/2023, 9:03 AMTomCarnay
03/17/2023, 9:29 AMjimbo123
03/17/2023, 10:20 AMsupabase.from("designs").select("name");
As a test I used the default RLS policy of "Enable read access for all users" and it works.
But I actually want to restrict access to logged in users. I made this policy but now the client gets an empty array instead of table data:
CREATE POLICY "Enable select for authenticated users only" ON "public"."designs"
AS PERMISSIVE FOR SELECT
TO authenticated
USING (true)
I used the email magic link authentication method. With the useUser
hook I can see the user is authenticated (I can see the ID, email address, etc).
Im brand new to Supabase. Any help debugging this would be much appreciated.itsnftsergio
03/17/2023, 10:25 AMEntropy
03/17/2023, 10:36 AMlflserg
03/17/2023, 11:55 AMb600
03/17/2023, 12:48 PMsetSession
, which validates everything and seems to give a proper response. However, when immediately calling getSession
after setting the session it seems like the session was never set. Here is the code I'm using and the corresponding output:
const supabaseClient = createClient(import.meta.env.VITE_SUPABASE_URL, import.meta.env.VITE_SUPABASE_ANON_KEY)
const refreshToken = cookie.get("my-refresh-token");
const accessToken = cookie.get("my-access-token");
if (refreshToken && accessToken) {
const res = await supabaseClient.auth.setSession({
refresh_token: refreshToken.value,
access_token: accessToken.value,
});
console.log("Validated token when initializing client >>> " + JSON.stringify(res.data.session?.access_token))
console.log("Getting the new session right after >>> " + JSON.stringify(await supabaseClient.auth.getSession()))
}
Output:
Validated token when initializing client >>> "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJhdWQiOiJhdXRoZW50aWNhdGVkIiwiZXhwIjoxNjc5MDU4NTI5LCJzdWIiOiJiNjIyMTY2Ny1hZGQ2LTQ2YWEtOWM1Ny0xOTNlNjMyNmIzMWUiLCJlbWFpbCI6ImZvb2Zvb0BiYXJiYXIuY29tIiwicGhvbmUiOiIiLCJhcHBfbWV0YWRhdGEiOnsicHJvdmlkZXIiOiJlbWFpbCIsInByb3ZpZGVycyI6WyJlbWFpbCJdfSwidXNlcl9tZXRhZGF0YSI6e30sInJvbGUiOiJhdXRoZW50aWNhdGVkIiwiYWFsIjoiYWFsMSIsImFtciI6W3sibWV0aG9kIjoicGFzc3dvcmQiLCJ0aW1lc3RhbXAiOjE2Nzg5NjI5MTh9XSwic2Vzc2lvbl9pZCI6IjhhMWIzYjNjLWYxMmMtNDcwYy05MDg0LWRhZDZkYjlkMGE2YiJ9.ehZMXCMa_FVmY1kXdLkNlkorbVw1ghKJpEWWxEnPYzQ"
Getting the new session right after >>> {"data":{"session":null},"error":null}
Thanks for your help! I'm very confused by thischrtravels
03/17/2023, 1:09 PM<button className="button block" onClick={() => supabase.auth.signOut()}>
However the docs for sign out show that we should use await:
const { error } = await supabase.auth.signOut()
supposedly it is supposed to trigger a sign out event but nothing visibly happens.
Thank you!kompiledstore
03/17/2023, 1:49 PMSparK
03/17/2023, 2:53 PMMATTI
03/17/2023, 2:56 PMbencehusi
03/17/2023, 3:01 PMteams
table should allow authenticated users to retrieve teams they belong to:
My USING expression is the following:
pgsql
id IN (
SELECT user_id
FROM public.team_users tu
WHERE tu.user_id = auth.uid()
)
What is wrong with this expression? Why does it return zero results while my user clearly belongs to two teams?ryanwelcher
03/17/2023, 3:35 PMsupbase db export
but that command doesn't seem to exist. Any help would be greatly appreciated!