https://supabase.com/ logo
Join Discord
Powered by
# help
  • u

    user

    08/03/2021, 7:56 AM
    Hi everyone, is there a PHP SDK for Supabase?
  • d

    DharmaraJ

    08/03/2021, 8:03 AM
    It seems I just need to paste the query in
    .select('')
  • c

    carlomigueldy.eth

    08/03/2021, 8:12 AM
    Hi Hi. How do we perform a GROUP BY query?
  • m

    magicquin

    08/03/2021, 8:37 AM
    Morning All
  • j

    jbergius

    08/03/2021, 8:37 AM
    Hi! Im using the Supabase UI Auth component to enable Facebook login for my app. Having some issues with the signup/login-flow with the following error message after being redirected back from facebook. Anyone else faced the same issue? The strange thing is that it's working fine if I'm logged in to my own facebook account. But when I'm trying to log in using my wife's facebook account, I get this error.
    k
    • 2
    • 12
  • s

    silentworks

    08/03/2021, 9:10 AM
    Cannot INSERT a new record if SELECT policy is not satisfied
  • s

    silentworks

    08/03/2021, 9:11 AM
    How to handle complex queries
  • k

    Kang Ming

    08/03/2021, 10:11 AM
    Error getting user email from external provider
  • y

    YelloJello

    08/03/2021, 10:49 AM
    if you use the secret key when creating a client, could you overwrite policies? aka do things that are denied via policies? kinda like using the admin sdk with a service account when using firestore
  • m

    Mihai Andrei

    08/03/2021, 12:39 PM
    If you use the secret key, you can bypass the policies from what i know
  • j

    Jasper

    08/03/2021, 1:21 PM
    Hey i'm having an issue where my react state is just a empty array in the db INSERT event
  • j

    Jasper

    08/03/2021, 1:21 PM
    Copy code
    jsx
    const [todos, setTodos] = useState([])
    
        useEffect(() => {
            supabase.from("todos").select().then(res => {
                const list = [];
                for (let todo of res.data) {
                    list.push(todo)
                }
                setTodos(list)
            })
    
            supabase.from("todos")
                .on("INSERT", payload => {
                    setTodos([payload.new, ...todos])
                })
                .subscribe(payload => {
                    console.log('schema ', payload)
                })
    
        }, [])
  • j

    Jasper

    08/03/2021, 1:21 PM
    The todos array actually does contain data
  • j

    Jasper

    08/03/2021, 1:22 PM
    It's just that in the supabase live callback that it's empty
  • y

    YelloJello

    08/03/2021, 2:13 PM
    you have to enable realtime for your todos table by going to your dashboard, then database -> replication ideally you'd delete the supabase_realtime publication that exists by default and add only the tables that you want realtime enabled in
  • j

    Jasper

    08/03/2021, 2:18 PM
    I did
  • j

    Jasper

    08/03/2021, 2:19 PM
    Its jusr that in the callback my local state is empty
  • s

    silas

    08/03/2021, 4:26 PM
    I am trying to redirect a user if they’re logged in on page load and I can’t for the life of me figure out how. I’ve been using
    supabase.auth.user()
    and
    supabase.auth.session()
    but often the page loads before the auth values are fetched and updated. How are you guys handling this?
    s
    f
    • 3
    • 14
  • s

    silas

    08/03/2021, 4:34 PM
    Typically, if these functions returned a Promise everything would work great, but since they don’t I’m dumbfounded how to block my middleware or trigger a function when the values are updated and correct
  • b

    brohan

    08/03/2021, 4:37 PM
    Are you using react by chance? If so, a useEffect with a session dependency may solve the problem
  • s

    silas

    08/03/2021, 4:43 PM
    Unfortunately, I’m not—I’m using Vue/Nuxt/Gridsome and SvelteKit. But thanks, I’ll file this away for when I do!
  • s

    silas

    08/03/2021, 4:46 PM
    I’m specifically using the
    handle()
    hook that runs as on every route change in SvelteKit https://kit.svelte.dev/docs#hooks-handle
  • s

    silas

    08/03/2021, 4:54 PM
    supabase.auth.session
    is
    null
    on page load when user is logged in
  • n

    nicholaschiang

    08/03/2021, 5:13 PM
    How does one perform an
    upsert
    when multiple columns have a
    unique
    constraint? Ex: I want to insert a new row into
    users
    if a row with the given ID doesn't already exist. If a row already exists with the same ID, I want to override that existing row BUT I still want to check that the new email and phone will be unique (i.e. if they're the same as the old email/phone, it doesn't matter BUT if they're different, than I want PostgreSQL to check that they're unique). Database schema:
    Copy code
    pgsql
    create table public.users (
      "id" text unique not null primary key,
      "email" text unique,
      "phone" text unique
    );
  • f

    fenix

    08/03/2021, 5:23 PM
    What's the proper return type for a function which should order and return a list of rows in a table?
    • 1
    • 3
  • s

    spiderz

    08/03/2021, 8:21 PM
    I am using magic link of Supabase for passwordless signup/signin in a Nextjs project. The link sent is for the base url of localhost:3000. Today, I hosted the code on Vercel. The signup email still sends the link with localhost:3000. How do I change that to actual production url link?
  • s

    ShaneTheKing

    08/03/2021, 8:24 PM
    In the settings of the app on supabase
  • s

    ShaneTheKing

    08/03/2021, 8:24 PM
    At the top it asks your apps url
  • s

    spiderz

    08/03/2021, 8:30 PM
    oh ok. Let me check that right now
  • s

    spiderz

    08/03/2021, 8:31 PM
    I saw it. Thanks a lot for pointing that out.
1...343536...316Latest