Kellen Mace
03/16/2023, 3:17 AMsupabase 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 of setting the postgres
user as a SUPERUSER
, then running a pg_dump
command to dump the database.Jinni
03/16/2023, 3:52 AMStuart81
03/16/2023, 3:59 AMàbć
03/16/2023, 6:19 AMsubscriptions
with one column user_id not null references auth.users.id
, and enable RLS so that only auth.uid() = user_id
can select
, is it ok to not add a is_subscribed bool not null
because simply doing a query, RLS passing would indicate that they are subscribed? The existence of a row with their uid would mean they are subscribed. is this a valid way to go or nah?Tissue
03/16/2023, 6:50 AMclaudemassaad
03/16/2023, 6:58 AMSkills
03/16/2023, 6:59 AMGaryLake
03/16/2023, 7:44 AMSaad
03/16/2023, 7:58 AMviktor
03/16/2023, 8:36 AMjs
await supabase.auth.signIn(
{ phone: fullPhoneNo.value },
{ redirectTo: window.location.origin }
);
This is the policy which should have given auth.users access. My guess is that there is another db user used for login?
sql
CREATE POLICY "auth.users can update own profile."
ON public.profile FOR UPDATE USING (
auth.uid() = id
);
This is my other policies related to auth.users trigger changes to profile. I guess I will get similar problems on some of them.
sql
CREATE POLICY "auth.users can select own profile."
ON public.profile FOR SELECT USING (
auth.uid() = id
);
CREATE POLICY "auth.users can insert own profile."
ON public.profile FOR INSERT WITH CHECK (
id = auth.uid()
AND
NOT exists (
SELECT 1 FROM public.profile WHERE id = auth.uid()
)
);
CREATE POLICY "auth.users can delete own profile."
ON public.profile FOR DELETE USING (
auth.uid() = id
);
hoj
03/16/2023, 9:13 AMPeanut
03/16/2023, 9:28 AM> supabase functions deploy discordbot --no-verify-jwt --import-map import_map.json "--import-map" "import_map.json"
Version 1.30.3 is already installed
Bundling discordbot
Error: Error bundling function: exit status 1
file:///src/import_map.json
file:///src/index.ts
error: Uncaught (in promise) Error: Module not found "npm:nacl@^0.1.3".
const ret = new Error(getStringFromWasm0(arg0, arg1));
My import (copied from article):
// Sift is a small routing library that abstracts away details like starting a
// listener on a port, and provides a simple function (serve) that has an API
// to invoke a function for a specific path.
import { json, serve, validateRequest } from "sift";
// TweetNaCl is a cryptography library that we use to verify requests
// from Discord.
import nacl from "nacl";
My import map:
{
"imports": {
"nacl": "npm:nacl@^0.1.3"
}
}
What is going wrong?オヌル
03/16/2023, 9:56 AMpeirix
03/16/2023, 10:27 AMPeanut
03/16/2023, 10:31 AM// Sift is a small routing library that abstracts away details like starting a
// listener on a port, and provides a simple function (serve) that has an API
// to invoke a function for a specific path.
// @ts-ignore
import { json, serve, validateRequest } from "sift";
// TweetNaCl is a cryptography library that we use to verify requests
// from Discord.
import * as nacl from "tweetnacl";
const valid = nacl.sign.detached.verify(
new TextEncoder().encode(timestamp + body),
hexToUint8Array(signature),
hexToUint8Array(PUBLIC_KEY)
);
But I get error
Error serving request: TypeError: Cannot read properties of undefined (reading 'detached')
My import map:
{
"imports": {
"sift": "https://deno.land/x/sift@0.6.0/mod.ts",
"tweetnacl": "https://unpkg.com/tweetnacl@^1.0.3"
}
}
How do I properly use tweetnacl?
I've also tried using the Deno re-package (https://deno.land/x/tweetnacl_deno@v1.0.3) but it says module not found
Btw new to Deno, not new to Node/TSahoogthomsen
03/16/2023, 10:59 AMconst sendResetPasswordEmail = async ({
email,
}: Omit<EmailAndPassword, 'password'>) => {
console.log({ email });
const { data, error } = await supabase.auth.resetPasswordForEmail(email);
console.log({ data, error });
return { data, error };
};
This is what i receive from the console.logs:
LOG {"email": "ahoog****@gmail.com"} (my correct email, blurred out of obvious reasons, however the correct one :) )
LOG {"data": {}, "error": null}
I can see in my users table that the user with the email is in the list of verified users (I've also tried to log in with that user, and it works successfully).
Does anyone have a clue why this isn't working?
Side note: I also tried to manually trigger a password recovery email via the Supabase dashboard, and that doesn't initiate a sendout either.itisnajim
03/16/2023, 1:17 PMdart
final client = SupabaseClient(
'URL_HERE',
'ANNON_KEY',
headers: {
'X-Client-Info': 'supabase-dart/1.6.0',
'header_name': 'header_value',
},
);
i want to access header_name value, using something like:
sql
select current_setting('request.header_name', true);
how can i achieve this?Peanut
03/16/2023, 2:52 PMError serving request: TypeError: Cannot read properties of undefined (reading 'href')
at getParameterByName (https://deno.land/x/gotrue@3.0.0/src/lib/helpers.ts:13:37)
at new GoTrueClient (https://deno.land/x/gotrue@3.0.0/src/GoTrueClient.ts:58:61)
at new SupabaseAuthClient (https://deno.land/x/supabase@1.3.1/src/lib/SupabaseAuthClient.ts:4:9)
at SupabaseClient._initSupabaseAuthClient (https://deno.land/x/supabase@1.3.1/src/SupabaseClient.ts:136:16)
at new SupabaseClient (https://deno.land/x/supabase@1.3.1/src/SupabaseClient.ts:55:26)
at createClient (https://deno.land/x/supabase@1.3.1/src/index.ts:5:12)
at Object.home [as /discordbot] (file:///src/index.ts:65:32)
at async handleRequest (https://deno.land/x/sift@0.6.0/mod.ts:58:36)
at async Server.#respond (https://deno.land/std@0.154.0/http/server.ts:219:24)
I tried switching the variable to SUPABASE_DB_URL
and also setting my own secret var but it doesnt work
My code:
import { createClient } from "@supabase/supabase-js";
const supabaseClient = createClient(
Deno.env.get("SUPABASE_URL") ?? "",
Deno.env.get("SUPABASE_ANON_KEY") ?? ""
);
Matthew 🦘🫕
03/16/2023, 3:21 PMjs
async updateDeck(deck: DeckUpdate) {
console.log("Pinia Update Deck", deck);
try {
const { error } = await supabase
.from('decks')
.upsert(deck)
console.log(error)
if (error) throw error;
} catch (error) {
console.log(error);
}
}
Here is the deckCreate model aswell
js
export interface DeckCreate {
user_id: number;
name: string;
description: string;
}
export interface DeckUpdate extends DeckCreate {
id: string;
}
Saad
03/16/2023, 3:32 PMviktor
03/16/2023, 3:40 PM[42501] ERROR: permission denied for schema public
as user postgres when trying to
sql
ALTER VIEW public.my_view OWNER TO authenticated;
I've tested
GRANT ALL PRIVILEGES ON SCHEMA public TO postgres;
I also get permission denied for schema public
when supabase_auth_admin tries to insert into a public table through a trigger.Peanut
03/16/2023, 3:43 PM.is()
operation on my Select query:
let query = supabaseClient
.rpc("searchassets", {
searchterm: searchTerm,
})
.select("*")
.limit(10)
.order("rank", {
ascending: false,
});
query = query.is("isadult", false);
I get error
Property 'is' does not exist on type 'PostgrestTransformBuilder<any, any, { [x: string]: any; }[]>'.ts(2339)
How do I fix this? Do I have to cast my query or something?
If I @ts-ignore it goes away and still workskillerthief
03/16/2023, 3:54 PMAbsolution585
03/16/2023, 3:59 PMyoni7022
03/16/2023, 4:26 PMSumit1993
03/16/2023, 5:11 PMSumit1993
03/16/2023, 5:18 PMDash
03/16/2023, 5:18 PMjeffarizona93
03/16/2023, 5:20 PM[ERROR] Consecutive reporter failure limit hit. No further attempts will be made.
I checked through the docs and couldn't find a match to anything. Also the realtime is working as expected. Anyone seen this error before?Irfan Ahmed
03/16/2023, 6:14 PM