rafael
03/01/2023, 12:48 AMCREATE OR REPLACE VIEW projects_public AS
SELECT P.id, P.name, P.description, P.instructions, P.created_at, U.first_name, U.last_name, U.avatar
FROM public.projects P
INNER JOIN public.user_profile U ON P.owner_id = U.owner_id
WHERE P.visibility = 'PUBLIC'
And I read something saying views are public. So I'm not sure if is public PUBLIC or is public available to authenticated users.
So, I tried to add authenticated only for this view...
ALTER VIEW projects_public OWNER TO authenticated;
But then I get an error:
Failed to run sql query: permission denied for schema public
Looks like this is not the correct way.
What I'm doing wrong?
Do I have to add this kind of role to access my view?
ThanksUnknown Member
03/01/2023, 2:53 AMericrav
03/01/2023, 2:56 AMcreateSupabase<Database>(
process.env.NEXT_PUBLIC_SUPABASE_URL!,
process.env.NEXT_PUBLIC_SUPABASE_ANON_KEY!,
{
global: {
headers: {
Authorization: `Bearer ${supabaseAccessToken}`,
},
},
},
);
Also, I'm running Supabase locally in Docker on macOS.
If I remove this Authorization header, the upload does work. However, I can use this custom JWT to insert data into the database without a problem and access my custom JWT data in the RLS policies for my table, so it seems to only affect the storage API. (I want to be able to access my custom JWT data in the storage bucket policy too, but currently I'm using a storage policy that evaluates to true
until I can get the upload working).
Searching the error "The parent resource is not found" on Google only returns a single result: https://www.reddit.com/r/Supabase/comments/1137lru/how_to_upload_through_http/
Any ideas what this means or how to further debug?nkeating
03/01/2023, 3:15 AMAgusjk
03/01/2023, 3:17 AMsinrabo
03/01/2023, 4:09 AMMoreeZ
03/01/2023, 4:20 AMUncaught TypeError: Cannot read properties of undefined (reading 'decode')
at new URLStateMachine (url-state-machine.js:541:1)
at module.exports.basicURLParse (url-state-machine.js:1259:1)
at new URLImpl (URL-impl.js:19:1)
at Object.setup (URL.js:73:1)
at new URL (URL.js:105:1)
at new SupabaseClient (SupabaseClient.ts:104:1)
at createClient (index.ts:38:1)
at ./src/state/supabase.js (supabase.js:6:1)
at __webpack_require__ (bootstrap:24:1)
at fn (hot module replacement:62:1)
supabase config
js
import "react-native-url-polyfill/auto";
import AsyncStorage from "@react-native-async-storage/async-storage";
import appjson from "../../app.json";
import { createClient } from "@supabase/supabase-js";
export const supabase = createClient(
appjson.supabase.url,
appjson.supabase.anon_key,
{
auth: {
storage: AsyncStorage,
autoRefreshToken: true,
persistSession: true,
detectSessionInUrl: false,
},
}
);
itzSuNNy
03/01/2023, 7:44 AMNJ™
03/01/2023, 8:03 AMlecookie
03/01/2023, 8:03 AMNicolasM
03/01/2023, 8:55 AMJafrilli
03/01/2023, 9:03 AMsupabase start
. I'm trying to import createClient, SupabaseClient, and other objects from 'https://esm.sh/@supabase/supabase-js@2' to use within my edge functions. Using supabase functions serve <edge function name>
results in this error: error: TS2305 [ERROR]: Module '"internal:///missing_dependency.d.ts"' has no exported member 'createClient'
. This has never happened before, and I'm honestly not sure what I did to make this happen. Not sure where to begin solving this to be honest. I stopped and started my local supabase, updated the CLI, but nothing I can think of is working. Is there a particular reason why this is happening?
This is my function. It is basically the default template, with the added import.
ts
import { serve } from 'https://deno.land/std@0.168.0/http/server.ts'
import { createClient } from 'https://esm.sh/@supabase/supabase-js@2' // <- causes the typescript error. seems like the types are not getting imported, which is weird, since this has never happened before.
console.log('Hello from Functions!')
serve(async req => {
const { name } = await req.json()
const data = {
message: `Hello ${name}!`
}
return new Response(JSON.stringify(data), {
headers: { 'Content-Type': 'application/json' }
})
})
Richard77
03/01/2023, 10:04 AMFayyaz
03/01/2023, 10:39 AMDevThoughts
03/01/2023, 10:54 AMRichard77
03/01/2023, 12:21 PMOleksandr Nedilko
03/01/2023, 1:16 PMonAuthStateChange()
doesn't work across tabs. But I suppose this is not true. I setup next js 13 project with app directory routing, wrapped onAuthStateChange
in useEffect
callback with empty array of dependencies, and added condition it event === "PASSWORD_RECOVERY"
then show password reset modal. When I follow password recovery link, it opens in new tab, modal shows and everything is okay. Except one thing - this modal also opens in initial tab, from which I invoked the process of restoring password. So the issue here is when I reset password from newly opened tab (the one opened by following password reset link), this reset password modal closes after successful password reset, but on the initial tab (the one from which I initialised password reset procedure), password reset modal also appears and not closes until I manually go to this initial tab and close this modal. Is this expected behaviour of onAuthStateChange
or I'm doing something wrong with my application state?Funky Duck
03/01/2023, 2:18 PM/token
per minute.
I am using the Flutter SDK, is this normal? There must be something wrong?!peepoo
03/01/2023, 2:23 PMHugos
03/01/2023, 3:39 PMŘambo
03/01/2023, 3:43 PMJaba
03/01/2023, 4:23 PMprenx4x
03/01/2023, 4:23 PMgintruxx
03/01/2023, 4:43 PMdrewbie
03/01/2023, 5:07 PMHugos
03/01/2023, 5:25 PMjs
const { data, error } = await supabaseClient
.from("puzzles")
.select("*")
.eq('id', Math.floor(Math.random() * (50000)))
.lt('rating', 700)
.limit(1)
.single();
I want to retrieve a random row from puzzle where the rating column has a value thats less than 700, how could i achieve such a thing?DanMossa
03/01/2023, 5:45 PMbekathegooner
03/01/2023, 6:10 PMŘambo
03/01/2023, 6:30 PMlecookie
03/01/2023, 6:52 PM