Lukas V
12/01/2022, 3:46 PMsupabase gen types
and at the moment I'm unsure what to do with Json[]
types.
Do I manually change that Json
type to the actual structure that I use, or should I do something in supabase dashboard?Xki
12/01/2022, 9:11 PM.eq
filter to filter to the ones where the condition is met. But if there is no value, I don't want it to filter. How can I achieve this?MATTI
12/02/2022, 3:56 PMWizzel
12/05/2022, 6:16 PMizurugi
12/06/2022, 6:12 AMselect set_claim(new.id, 'claims_admin', 'true');
inside the handle user function to set the claim/update claims of registered users. But, I'm getting error whenever newly registered with that line added. I'm not sure what's the issue, I can't tell if its type error or the new object is not yet being created.
https://github.com/supabase-community/supabase-custom-claims.AB$TRACT
12/06/2022, 6:16 PMjs
const { data: country } = await supabaseService
.from("country")
.select("*, city(*)")
.eq("slug", params!.country)
.single();
Is there a way to do something like city(*) AS cities
without renaming my table ?drewbie
12/06/2022, 7:10 PMpackages/app/foo.ts
export function foo() { return true; }
packages/backend/supabase/functions
import { foo } from 'app';
TS2305 [ERROR]: Module '"deno:///missing_dependency.d.ts"' has no exported member 'foo'.
have also tried
import { foo } from '../packages/app/foo.ts'
and I get the same error.Yeehawlerz101
12/07/2022, 7:15 PMjs
export default async function load(){
let { data: count, error } = await supabase
.from('smsspam')
// My table is named smsspam
.select('*', { count: 'planned', head: true })
// selecting all entries in the table and counting them, using head because I only want the count.
//the results should look like:
// {"count": 3,"status": 200, "statusText": "OK" } but returns null.
console.log("Total Rows",count)
if (error) {
console.log(error.message);
}
return {
props:{count}
};
}
Neyunse
12/08/2022, 12:03 AMMikemartin
12/08/2022, 3:59 PMlegenden
12/09/2022, 7:19 AMstorage/v1/object/list/{bucketId}
With the following body:
json
{"limit":100,"offset":0,"sortBy":{"column":"name","order":"asc"},"prefix":"testpath"}
I get the following error:
json
{
"statusCode": "PGRST202",
"error": "",
"message": "Could not find the storage.search(bucketname, levels, limits, offsets, prefix, sortcolumn, sortorder) function or the storage.search function with a single unnamed json or jsonb parameter in the schema cache"
}
I run the docker-compose setup that is used in the storage-js repositoryMDobs
12/09/2022, 11:31 AM.on('system', {}, payload => {
console.log(payload)
if (payload.extension === 'postgres_changes' && payload.status === 'ok') {
if (initCallback) {
initCallback()
}
}
})
which allowed me to know when the subscription actually was established. Today it keeps firing continuously thus breaking the logic. Is there some new/other way to know when the realtime subscription has been established?quentin_guerrier
12/09/2022, 1:56 PMconst { data, error } = await $supabase.functions.invoke('cluster', {
body: { foo: 'bar' },
})
console.log(error, data)
this is my function
try {
const supabaseClient = createClient(Deno.env.get('SUPABASE_URL') ?? '', Deno.env.get('SUPABASE_ANON_KEY') ?? '', {
global: { headers: { Authorization: req.headers.get('Authorization')! } },
})
console.log('body', req.body)
const { data, error } = await supabaseClient.from(`poi_water`).select('*')
if (error) throw error
return new Response(JSON.stringify({ ...data }), {
headers: { 'Access-Control-Allow-Origin': '*', 'Access-Control-Allow-Headers': '*', 'Content-Type': 'application/json' },
status: 200,
})
} catch (error) {
return new Response(JSON.stringify({ error: error.message }), {
headers: { 'Access-Control-Allow-Origin': '*', 'Access-Control-Allow-Headers': '*', 'Content-Type': 'application/json' },
status: 400,
})
}
jameswilliam
12/09/2022, 3:36 PMconst { data: invite, error } = await supabase
.from('invites')
.select('*')
.eq('code', params.code)
.single()
params.code is a uuid grabbed from the URL, but I run into the following issue. It seems to think it's a mismatch type? Anyone know why this is happening and how to fix it?
{
code: '42883',
details: null,
hint: 'No operator matches the given name and argument types. You might need to add explicit type casts.',
message: 'operator does not exist: uuid = text'
}
YokoWasis
12/10/2022, 11:47 PMAndersR
12/11/2022, 4:33 PMSTILLWATER;
12/12/2022, 5:44 AMalvaro
12/12/2022, 4:48 PMローリー Laurie
12/13/2022, 8:28 AMLayoutLoad
and LayoutServerLoad
types don't seem to be there. Also, what file are those code snippets supposed to be in?
Code from the tutorial : js
import type { LayoutServerLoad } from './$types'
import { getServerSession } from '@supabase/auth-helpers-sveltekit'
export const load: LayoutServerLoad = async (event) => {
return {
session: await getServerSession(event),
}
}
thosta
12/13/2022, 8:41 AMharis2050
12/13/2022, 8:57 AMJulius
12/13/2022, 1:53 PMgetProfile
function everytime I switch from another browser tab back to my application, or switch between full screen and window mode (in Safari or Chrome on Mac OS). In the quickstart the function is triggered by the session object in the useEffect
hook:
ts
useEffect(() => {
getProfile();
}, [session]);
Session is initialized in the home page with the useSession
hook from @supabase/auth-helpers-react
. So the question is, why does this session object keep triggering effects in such a bizarre way? The user will see a loading state every time they switch browser tabs or full screen mode, and I'd like to know if this could be avoided.gaIaxy
12/13/2022, 5:14 PMGuy Rozen
12/13/2022, 7:27 PMDembe
12/14/2022, 2:47 PMValtoo16
12/14/2022, 3:07 PMtpc1
12/14/2022, 6:42 PMzilchg00d
12/14/2022, 7:22 PMaccess_token
is the one I want, but then, I'm not clear what the provider token is for. Any guidance here?steeze
12/14/2022, 11:28 PMSHOW server_version;
returns 15.1, yet I get the following error when trying to link my remote project to my local
Error: Failed reading config: Invalid db.major_version: 15.
Is this a bug?funwithtriangles
12/15/2022, 10:20 AMdata: null,
error: {
name: "FunctionsHttpError"
message: "Edge Function returned a non-2xx status code"
}
The best solution I can come up with so far is to respond a 200 OK code, but with an error
object to signify an error, but then my response looks like this:
error: null,
data: {
error: { // whatever }
}
So now I have to check for error
or data.error
which feels strange to me 🤷
Anyone else having this problem? Any better solutions?