DEPSTRCZ
03/01/2023, 7:09 PMHuxwell
03/01/2023, 7:46 PMsupabase.auth.signIn
doesn't persist any session since the request is made server side.
Can you provide guidance on the steps I should take to make this work ? Is it even possible to use the supabase client only server side ?
ThanksHuxwell
03/01/2023, 7:56 PMaccess to auth schema denied
.
I tried to create the function on the auth schema instead but then I can't call the procedure using the supabase client since supabase.rpc('my_function')
is looking for public.my_function instead of auth.my_functionVik
03/01/2023, 8:17 PMfull_name_regex
constraint so there are no spaces before and after, one space between, and only letters.
This works on my front end but for some reason always fails on my database insert.
ALTER TABLE profiles
ADD CONSTRAINT full_name_regex CHECK (full_name ~* '^\b(?!.*?\s{2})[A-Za-z ]{3,25}\b$');
Here is an example playground for this regex
https://regex101.com/r/vb1KqW/2Irfan Ahmed
03/01/2023, 8:18 PMfuriousgeorge
03/01/2023, 8:46 PMlecookie
03/01/2023, 9:10 PMspicypete
03/01/2023, 9:20 PM$ npx supabase db remote commit
Applying migration 20230301210435_remote_commit.sql...
Error: ERROR: extension "supautils" is not available (SQLSTATE 0A000)
At statement 17: --
-- Name: supautils; Type: EXTENSION; Schema: -; Owner: -
--
CREATE EXTENSION IF NOT EXISTS "supautils" WITH SCHEMA "extensions"
Try rerunning the command with --debug to troubleshoot the error.
jinsley8
03/01/2023, 10:14 PMzain
03/01/2023, 11:50 PMJaaneek
03/02/2023, 12:07 AMŘambo
03/02/2023, 1:37 AMkrummens
03/02/2023, 2:55 AMRole
field says supabase_admin
and Time Consumed
says 46.9%
. Here is the query:
sql
with pub as (
select
concat_ws(
$5,
case when bool_or(pubinsert) then $6 else $7 end,
case when bool_or(pubupdate) then $8 else $9 end,
case when bool_or(pubdelete) then $10 else $11 end
) as w2j_actions,
coalesce(
string_agg(
realtime.quote_wal2json(format($12, schemaname, tablename)::regclass),
$13
) filter (where ppt.tablename is not null),
$14
) w2j_add_tables
from
pg_publication pp
left join pg_publication_tables ppt
on pp.pubname = ppt.pubname
where
pp.pubname = $1
group by
pp.pubname
limit $15
),
w2j as (
select
x.*, pub.w2j_add_tables
from
pub,
pg_logical_slot_get_changes(
$2, $16, $3,
$17, $18,
$19, $20,
$21, $22,
$23, $24,
$25, $26,
$27, pub.w2j_actions,
$28, pub.w2j_add_tables
) x
)
select
xyz.wal,
xyz.is_rls_enabled,
xyz.subscription_ids,
xyz.errors
--- ...shortened for character limit
I can tell this has to do with replication, but I can't figure out why it's being called so often. This query is being run while there are currently 3 or so active users.
For reference, I set up a custom publication to stream data for three tables to a separate server, but the data in those tables only change once per day.
Another thing I noticed that could be related is the Realtime logs are showing this log three times per second: Billing metrics: [:realtime, :connections]
Any help for why this is happening?CELESTIALCITY
03/02/2023, 4:45 AMnimo
03/02/2023, 5:01 AMCREATE TABLE project (
"id" "uuid" DEFAULT "extensions"."uuid_generate_v4"() NOT NULL,
...
)
CREATE TABLE project_user (
"id" "uuid" DEFAULT "extensions"."uuid_generate_v4"() NOT NULL,
"user_id" "uuid" NOT NULL,
"project_id" "uuid" NOT NULL
)
CREATE TABLE interview (
"id" "uuid" DEFAULT "extensions"."uuid_generate_v4"() NOT NULL,
"project_id" "uuid" NOT NULL,
)
CREATE TABLE interview_question (
"id" "uuid" DEFAULT "extensions"."uuid_generate_v4"() NOT NULL,
"interview_id" "uuid" NOT NULL,
)
Essentially, users are added to projects in the project_user table. I'd like to add RLS to ensure that users can only SELECT / INSERT / UPDATE / DELETE interview questions if they can access the top level project table.
Would it be possible to either send a new header value that shows what project the user is currently on and use that to reference the project_user
table?
Alternatively, would it be better (or more secure) to write an RLS command that does some joins to make sure that the interview_question
is accessible by that user
by seeing if there's an entry in the project_user
table based on interview_question
-> interview
-> project
?krummens
03/02/2023, 5:21 AM2023-03-01 22:01:08.075 MST [742391] LOG: logical replication apply worker for subscription "supabase_gis_subscription" has started
2023-03-01 22:01:08.076 MST [585675] LOG: background worker "logical replication worker" (PID 634943) exited with exit code 1
2023-03-01 22:01:09.078 MST [742391] ERROR: could not start WAL streaming: ERROR: cannot read from logical replication slot "supabase_gis_subscription"
DETAIL: This slot has been invalidated because it exceeded the maximum reserved size.
There are probably 100 of these logs. The only thing that happened is about 400 rows were updated on one of the publication tables. Those changes occurred over the course of about 10 minutes, so I can't imagine that was too much for the server to handle.
Any help?bekathegooner
03/02/2023, 7:06 AMSTILLWATER;
03/02/2023, 9:32 AMrmi111
03/02/2023, 11:45 AMMarkus Geilehner
03/02/2023, 11:52 AMawait useSupabaseClient().functions.invoke(
`get-ticket-information/${props.ticketId}`,
{
headers: {
method: 'GET',
},
}
)
jdom93
03/02/2023, 11:58 AMJakub Zakrzewski
03/02/2023, 12:02 PMdspe
03/02/2023, 1:52 PMbreezeways
03/02/2023, 2:02 PMconst { error } = await supabaseClient.auth.signInWithOAuth({
provider: "google",
options: { redirectTo },
});
I am redirect to a page that tells me the provider is not enabled
with a 400
code. How can I debug this or move forward?jumeh
03/02/2023, 2:11 PMcodedao
03/02/2023, 2:24 PMLothar
03/02/2023, 3:13 PMconst { data:user, error } = await supabase
.from(this.TABLE_NAME)
.select(`*,
deck:aw-decks(*,
cards:aw-deck-cards(card:card_id(*))
)
`)
.eq('id',userID)
.maybeSingle()
Which is returning this data:
{
"id": 1,
"created_at": "2022-09-10T01:37:22.741861+00:00",
"username": "Lothar",
"hero": 77,
"deck_id": 1,
"deck": {
"id": 1,
"name": "Alpha Starter",
"cards": [
{
"card": {
"id": 1,
"name": "Ancient",
"type": 0,
"cost": 1,
"key": "ancient",
"attack": 2,
"attackType": 2,
"attackSlots": 5,
"defense": 2,
"defenseType": 2,
"boonType": null,
"statType": null
}
}
]
}
}
Just wondering if there's a way to format the query so that I can instead get the cards object as this (basically without the sublevel card
):
"cards": [
{
"id": 1,
"name": "Ancient",
"type": 0,
"cost": 1,
"key": "ancient",
"attack": 2,
"attackType": 2,
"attackSlots": 5,
"defense": 2,
"defenseType": 2,
"boonType": null,
"statType": null
}
]
Thanks!theravenstone
03/02/2023, 3:46 PMVimes
03/02/2023, 3:47 PMjs
import { Auth, ThemeSupa } from '@supabase/auth-ui-react'
import { useUser, useSupabaseClient } from '@supabase/auth-helpers-react'
import { useEffect, useState } from 'react'
const LoginPage = () => {
const supabaseClient = useSupabaseClient()
const user = useUser()
console.log("User is", user)
if (!user)
return (
<Auth
appearance={{ theme: ThemeSupa }}
supabaseClient={supabaseClient}
/>
)
return (
<>
<p>Userdata is:</p>
<pre>{JSON.stringify(user, null, 2)}</pre>
</>
)
}
export default LoginPage
Ethan Hill
03/02/2023, 3:54 PMnpx supabase gen types typescript --db-url xxx.supabase.co
But it seems to keep returning this error
Error: URL is not a valid Supabase connection string: cannot parse "xxx.supabase.co": failed to parse as DSN (invalid dsn)
Any ideas on what I might be doing wrong?