MaheshtheDev
12/29/2022, 6:54 AMShawn Conecone
12/29/2022, 8:50 AMconst listener = supabase
.channel('*')
.on(
'postgres_changes',
{
event: '*',
schema: '*'
},
(payload) => {
console.log({ payload });
}
)
.subscribe();
I'm currently using the anon key to connect.
Testing this with making updates to a row of a table that has its RLS disabled doesn't trigger the callback function. Any idea why?
Thanks!moroshko
12/29/2022, 9:42 AM@supabase/auth-helpers-nextjs
?Cheqo
12/29/2022, 10:22 AMAllow insert if "is_admin" = true
, however what is the SQL equivalent?lake_mattiato
12/29/2022, 10:24 AMinvalid input syntax for type uuid ...
Mihai Andrei
12/29/2022, 12:12 PM/auth/v1/token?grant_type=refresh_token
with { refresh_token: "the-refresh-token" }
I'm using supabase only on the server, and I need to create an endpoint to refresh the token.TheCodeMonkey
12/29/2022, 1:17 PMoleg
12/29/2022, 1:38 PMHermes
12/29/2022, 1:44 PMJSON
{
"statusCode": "403",
"error": "FeatureNotEnabled",
"message": "feature not enabled for this tenant"
}
iStun4Fun
12/29/2022, 1:47 PM// Fetch all royalties by Label and Time, Group by Date and Type
export function useRoyaltiesByLabel(labelId) {
return useQuery(
["royalties", { labelId }],
() =>
supabase
.from("royalties")
.select(`date, label_id, SUM(total_revenue) as total_revenue, type`)
.eq("label", labelId)
.groupBy (["type", "date"])
.order("createdAt", { ascending: false })
.then(handle),
);
}
Alon
12/29/2022, 2:15 PMconst { data, error } = await client
.from('custom-messages')
.select(
`id, content, show_in_all_groups, updated_at, created_at
profile:profile_id (
id,
full_name,
avatar_url
),
groups:groups_custom-messages (
group_id
)
`
)
.eq('groups.group_id', groupId)
However I still get back ALL customMessages without consideration for filtering by group.group_id
I am on Client v1.3 because there were issues with RedwoodJS Auth when updating.CherterB
12/29/2022, 2:46 PM19
12/29/2022, 4:43 PM{"statusCode":"400","error":"Invalid JWT","message":"jwt expired"}
Is there any way to increase the timeout period for file storage URLs?organicnz
12/29/2022, 5:55 PMjakeAnon
12/29/2022, 6:10 PMawait supabaseClient.auth.signInWithOtp({
email,
options: {
emailRedirectTo: "http://localhost:3000/form",
},
Ive tried using above as well as
const { isLoading } = useSessionContext();
to try and let the session load in but the page still flickers before redirect.
I would appreciate any help, thank you!DarthJarJar
12/29/2022, 7:20 PMgtims123
12/29/2022, 7:27 PMWizzel
12/29/2022, 9:09 PMLukas V
12/29/2022, 11:25 PMauth.users
table which I assume is created automatically by supabase.
Can I use auth.users table to query for this info - email, created_at date or should I add it to my public users table as well?usamichizuru
12/30/2022, 4:32 AMjs
const {data,error} = await supabase.from("table").filter('foreign_table.count', 'eq', 2);
and got error aggregate functions are not allowed in WHERE. Now I know that count has to use in having method so how am I going to query this. Also rpc is my last option.mingfang
12/30/2022, 5:29 AMNilu
12/30/2022, 6:37 AMNeki
12/30/2022, 7:00 AMrchrdnsh
12/30/2022, 7:58 AMmaniak
12/30/2022, 10:19 AMccssmnn
12/30/2022, 1:43 PMselect true or cast('bla' to int) > 4;
throws a cast error. I was expecting the cast to be skipped, since it should not be evaluated because of the true
before the or
. That assumption is wrong.
Context:
I store form submissions in a table where each field of the submission is its own row. Fields can be of type text
, number
, ... and their value is always a string just like HTML fields. I want to check if the submitted number is greater than the minimum value, but only if it is a number field.Gonza
12/30/2022, 2:30 PMMartacus
12/30/2022, 3:00 PMCRSHR21
12/30/2022, 5:00 PMts
export default function App({
Component,
pageProps,
}: AppProps<{
initialSession: Session;
}>) {
const [supabase] = useState(() => createBrowserSupabaseClient());
return (
<SessionContextProvider
supabaseClient={supabase}
initialSession={pageProps.initialSession}
>
<Provider store={store}>
<Component {...pageProps} />
</Provider>
</SessionContextProvider>
);
}
Here's the middleware code (it's basically copied from the docs):
ts
export async function middleware(req: NextRequest) {
const res = NextResponse.next()
const supabase = createMiddlewareSupabaseClient({ req, res })
const {
data: { session },
} = await supabase.auth.getSession()
console.log("sess",session); // -> returns null
// rest of the logics...
}
Any ideas?Askar
12/30/2022, 5:01 PM