dayvista
03/20/2023, 12:03 AMredirectTo
option
It seems like no emails have been sent after 10+ attempts. Is there something I'm missing?staya
03/20/2023, 1:01 AM{{ .Token }}
sent in the email so they don't need to click the link in the inbox.
Type seems to support this, but I'm not sure how do I rewrite the function? Do I check if the code var exists and then pass it with signInWithOtp({})
? That don't seem to be expected...Cybear
03/20/2023, 1:32 AMimagio
03/20/2023, 1:39 AMsupabase funcions serve
they crash when any code accesses some node globals such as performance.now()
. They crash because the global performance is undefined
The strange thing is that the same code works perfectly fine when running locally with deno run -A ./my_code.ts
. It's only the edge runtime that for some reason seems to be missing Deno builtin globals like performance
.
Am I missing something? Is this a bug in the edge runtime? It it expected but just not documented? Any pointers would be appreciated, thanks!NinjaNuur
03/20/2023, 5:59 AMAmr
03/20/2023, 6:01 AMsupabase db diff --use-migra
I get a long error (attached).
My supabase CLI: 1.42.7
I disabled ufw
, but still no difference.jt
03/20/2023, 6:14 AMH1net
03/20/2023, 11:39 AMsupabase start
eimenhmdt
03/20/2023, 12:15 PMjoaquimley
03/20/2023, 12:20 PMack210
03/20/2023, 12:37 PMsupabase db remote commit
to pull down changes from the remote db. When running this command, I receive the following error:
> Error: Error running pg_dump on remote database: Error response from daemon: operation is not permitted on predefined host network
I've tried resetting docker to factory defaults and still no luck, and not really sure what to do to troubleshoot further. I have Docker Desktop for Windows (using WSL 2). I've also attached the full output when using the --debug
flag with the command.
Thanks for any help!Razoth
03/20/2023, 2:09 PMLukas V
03/20/2023, 2:48 PMconst { error } = await supabaseClient.auth.resetPasswordForEmail(
data.email,
{
redirectTo: `${getURL()}/reset-password`
}
);
However, when i receive email link, I am logged in and redirected to home page instead of reset-password
nitishk72
03/20/2023, 2:51 PMjson
{
"message":"No API key found in request",
"hint":"No `apikey` request header or url param was found."
}
PGF_GAMING
03/20/2023, 2:54 PMDisamDev
03/20/2023, 3:03 PMFilippoBrigati
03/20/2023, 3:11 PMKirioXX
03/20/2023, 3:35 PMGurkanG
03/20/2023, 4:31 PMisValidToken(token)
.
But I'm unsure how to access this from my C# code. I haven't been able to find out if I can directly call auth endpoints of my Supabase instance, like for instance /verifyToken
(or similar).
Do I need to build a "translation service" that uses the official libraries so I can use something like supabase.auth.api.getUser('ACCESS_TOKEN_JWT')
which returns if if there is an active session.
I haven't been able to find an equivalent solution in the C# community library.
Is there a better/easier way to solve this problem?Entropy
03/20/2023, 4:44 PMts
const { data, error } = await supabase.storage
.from('avatars')
.remove([`${user.id}/small.png`, `${user.id}/medium.png`, `${user.id}/large.png`])
Delete Policy (authenticated):
sql
((bucket_id = 'avatars'::text) AND ((storage.foldername(name))[1] = (auth.uid())::text))
zachblume
03/20/2023, 4:49 PM-- Create foreign data wrapper to fec
CREATE EXTENSION postgres_fdw;
GRANT USAGE ON FOREIGN DATA WRAPPER postgres_fdw TO postgres;
CREATE SERVER fec FOREIGN DATA WRAPPER postgres_fdw OPTIONS (
host '...hostname...',
port '5432',
dbname 'postgres'
);
CREATE USER MAPPING FOR postgres SERVER fec OPTIONS (
user 'postgres',
password '...password...'
);
-- Create foreign table
create foreign table indiv14 (
...ddl....
);
And there is a compound (btree) index in indiv14, so that locally it uses an index scan:
EXPLAIN VERBOSE select * from indiv14 where name='sdfsdf' limit 25;
Limit (cost=0.43..10.47 rows=8 width=148)
-> Index Scan using indiv14_name_zip_code_idx on public.indiv14 (cost=0.43..10.47 rows=8 width=148)
Index Cond: ((indiv14.name)::text = 'sdfsdf'::text)
Query Identifier: -2987151377721656964
But when I use the foreign data wrapper, I get a scan:
Limit (cost=100.00..111.67 rows=1 width=596)
-> Foreign Scan on public.indiv14 (cost=100.00..111.67 rows=1 width=596)
Remote SQL: SELECT cmte_id, amndt_ind, rpt_tp, transaction_pgi, image_num, transaction_tp, entity_tp, name, city, state, zip_code, employer, occupation, transaction_dt, transaction_amt, other_id, tran_id, file_num, memo_cd, memo_text, sub_id FROM public.indiv14 WHERE ((name = 'sdfsdf'))
HelpOberstKlinck
03/20/2023, 4:53 PMauth.users
table. and the Users overview doesn't allow for an email change.
How can I do it?Martin INDIE MAKERS
03/20/2023, 7:43 PMts
export const useSupabaseTest = (capgkey: string) => {
const options: SupabaseClientOptions<'public'> = {
global: {
headers: {
capgkey,
},
}
}
return createClient<Database>(supabaseUrl, supabaseAnonKey, options)
}
That allow me to check the capgkey in RLS with
sql
(current_setting('request.headers'::text, true))::json ->> 'capgkey'::text)
That work like a charm.
Sadly with realtime query the RLS prevent the event to be broadcast.
i tried to follow what is said here: https://supabase.com/docs/guides/realtime/postgres-changes#custom-tokens
and updated my code like that
ts
export const useSupabaseTest = (capgkey: string) => {
const options: SupabaseClientOptions<'public'> = {
global: {
headers: {
capgkey,
},
},
realtime: {
params: {
capgkey,
},
},
}
return createClient<Database>(supabaseUrl, supabaseAnonKey, options)
}
I can see in my front capgkey is sended but the broadcast still not happen.
Do someone know how to handle this case, or at least how to inspect logs on
Supabase side to know whats happening ?twotwice
03/20/2023, 8:50 PMDYELbrah
03/20/2023, 9:15 PMBenanna19
03/20/2023, 10:30 PMLar
03/20/2023, 10:50 PMsource .env && prisma migrate dev
Environment variables loaded from .env
Prisma schema loaded from prisma\schema.prisma
Datasource "db": PostgreSQL database "xxx@db.xxx.supabase.co:5432/postgres", schemas "public"
Error: P1001: Can't reach database server at `localhost`:`5432`
Please make sure your database server is running at `localhost`:`5432`.
[1]+ Done DATABASE_URL=postgresql://postgres:xxx@db.xxx.supabase.co:5432/postgres
Larry@ASUS MINGW64 /c/__repos/_wip/pinz.ai (main)
$ source .env && prisma migrate dev
Environment variables loaded from .env
Prisma schema loaded from prisma\schema.prisma
Datasource "db": PostgreSQL database "xxx@db.xxx.supabase.co:5432/postgres", schemas "public"
Error: P1001: Can't reach database server at `localhost`:`5432`
Please make sure your database server is running at `localhost`:`5432`.
NOTE
I CAN connect to db using datagrip. I SEE db in SB Dashboard.
My schema.prisma partial:
generator client {
provider = "prisma-client-js"
previewFeatures = ["multiSchema"]
}
datasource db {
provider = "postgres"
url = env("DATABASE_URL")
directUrl= env("DIRECT_URL")
schemas = ["public"]
}
I have experienced issues with Dashboard involving messages like:
Problem access project statistics
, Project doesn't exist (top right toast)
, duplicate project names
.
Currently unable to proceed.Vik
03/20/2023, 10:59 PMapproved
column on my relationships
table can be updated if it has not already been approved.
This is what I have but I run into this error:
Error adding policy: failed to create pg.policies: missing FROM-clause entry for table "new"
fowl
03/20/2023, 11:59 PMimport "https://deno.land/x/dotenv@v3.2.2/load.ts"
import { createClient } from 'https://esm.sh/@supabase/supabase-js@2.10.0'
import { ensureDirSync } from "https://deno.land/std@0.178.0/fs/ensure_dir.ts"
...
const supabaseUrl = Deno.env.get("SUPABASE_URL")
const supabaseKey = Deno.env.get("SUPABASE_KEY")
const supabase = createClient<Database>(supabaseUrl, supabaseKey)
...
const doDownloads = async () => {
// getting storage download paths
console.log(Deno.resources()) // { "0": "stdin", "1": "stdout", "2": "stderr" }
const { data, error } = await supabase
.from('myTable')
.select<'*', RowType>()
console.log(Deno.resources()) // { "0": "stdin", "1": "stdout", "2": "stderr", "3": "timer" }
// ensures dir exists with ensureDirSync then downloads with supabase.storage
}
...
doDownloads()
.then(() => {
console.log('Downloads complete!')
console.log(Deno.resources()) // { "0": "stdin", "1": "stdout", "2": "stderr", "3": "timer" }
})
.catch((err) => {
console.error(err)
console.log(Deno.resources()) // { "0": "stdin", "1": "stdout", "2": "stderr", "3": "timer" }
})
console.log('Downloading...')
console.log(Deno.resources()) // { "0": "stdin", "1": "stdout", "2": "stderr" }
export {}
Ran with deno run --allow-env --allow-net --allow-read --allow-write deno/doDownloads.ts
So as shown in the comments in the code, the .select
query from the supabase
client creates some timer resource that is not cleaned up properly.
This is an issue because the script will hang/will not exit after being ran, unless I add Deno.close(3)
to the .then
and .catch
functions.
This does not occur when I convert the script to Node.js, but I have no way of knowing if this is a Deno transpilation or Supabase client issue.brt
03/21/2023, 12:28 AMsupabase db reset
, the buckets are gone.
I'm wondering if there's a simple way to persist it from the command line, like with the public schema and its migrations files.
If not: what best practice do you suggest? I was thinking about pg_dump it in binary and add the output on my project.