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

    Marky

    10/26/2021, 3:34 PM
    I'm trying to store supabase subscription object in Vuex state, and I get the error 'TypeError: Converting circular structure to JSON' anyone know a solution?
  • o

    Opossible

    10/26/2021, 3:36 PM
    I have a data structure that looks like:
    Copy code
    let exercises = ([
        {
            id: uid++,
            name: 'skin the cat 5x2',
            sets: [false, false, false, false, false],
        },
            ...
    What is the best way to store that in postGres? I tried the 'text' type with "Define as Array" checked, but it's coming back from the database with extra double quotes and backslashes...
  • m

    Marky

    10/26/2021, 3:37 PM
    can't turn it into a relational model?
  • o

    Opossible

    10/26/2021, 3:55 PM
    Figured it out. It just needed to be defined as json.
  • w

    wiesson

    10/26/2021, 6:26 PM
    Can I run supabase requests within a vercel edge function?
    h
    • 2
    • 2
  • b

    braedenf

    10/26/2021, 7:11 PM
    Does anyone know of a standard and simple way to do serverside authentication for a social provider on a endpoint in Sveltekit? I can authenticate and redirect simply with standard Auth but I can't seem to get the redirect working for the social method, I have to refresh the page and then it redirects,anyone have an inkling of what might be going on?
  • s

    Señor Bruno

    10/26/2021, 7:16 PM
    is it possible to get an url for a storage object instead of the blob directly? (with auth)
  • b

    braedenf

    10/26/2021, 8:01 PM
    In classic tradition of solving your own problem 😆 I played around till it worked. I'm not sure if it is the best way of doing it but I took the response from the endpoint fetch and then redirected. Here is the code if anyone can provide feedback
    Copy code
    html
    if (browser) {
            supabaseClient.auth.onAuthStateChange((event, _session) => {
                if (_session) {
                    fetch('/api/googleauth', {
                        method: 'post',
                        body: JSON.stringify({ event, _session })
                    }).then((res) => {
                        if (res.ok) window.location.href = '/';
                        else alert(res.text());
                    });
                }
            });
        }
  • v

    VuNguyen

    10/27/2021, 3:20 AM
    It works perfectly on my nodejs server, but when I query in nextjs serverside, it doesn't works
    • 1
    • 3
  • h

    haydn

    10/27/2021, 4:14 AM
    I'm running into "Connection terminated unexpectedly" errors when I try to rename a table (
    alter table "employees" rename to "people"
    ). I've tried doing it a few different ways. It's fine if I use the Supabase dashboard (using the UI or writing my own SQL), but if I connect directly via DBeaver the connection gets terminated when trying the run that statement. Is this expected behaviour or is something going wrong here?
    g
    • 2
    • 7
  • v

    VuNguyen

    10/27/2021, 4:20 AM
    I can't read data from a table with RLS enabled
  • f

    fergus

    10/27/2021, 8:39 AM
    User login: on successful authentication are we responsible for creating a cookie, or is the supabase JS library doing that? And if we are creating the cookie, what shape must it have? If for example we want to use
    supabase.auth.api.getUserByCookie(req)
    to get the user serverside?
  • f

    fergus

    10/27/2021, 10:13 AM
    I had the same issue renaming a table with DataGrip
  • e

    erik_flywheel

    10/27/2021, 10:49 AM
    I have a question on sql in general - I have a list of apartments with traits (has parking, allows pets, etc). When a user filters to "has parking", I want to only show the listings where that is true - which is easy. but if they arent filtering to that, i dont only want to show the listings where it's false (I want to show true & false). Do I need a different call for that? Wondering if I'll need a different call for every variation of the filtering
    g
    • 2
    • 3
  • t

    tamagoez

    10/27/2021, 12:48 PM
    Can we make authorize without Email? I want to make authorization only Username and Password.
    h
    • 2
    • 12
  • h

    HarryET

    10/27/2021, 1:24 PM
    Sadly not.
  • h

    HarryET

    10/27/2021, 1:24 PM
    Username & Password Auth
  • g

    garyaustin

    10/27/2021, 2:10 PM
    Connection Termination on Table Name Change
  • e

    erinstearns

    10/27/2021, 4:23 PM
    adding a constant. It works when I add the number by post request from my website but It doesn't work when manually updated or added
  • s

    spiderz

    10/27/2021, 4:55 PM
    we are building a chat functionality in our app but our realtime subscription is not working. We store our chats in a table called "messages". Here is the code that we are using. let chatSubscription = supabase .from('messages') .on('INSERT', payload => { console.log('Change received!', payload) }) .subscribe() The above code is never called when we insert new messages. We do have the realtime replication enabled for the table. Any help will be appreciated. Thanks.
    s
    g
    • 3
    • 7
  • s

    silentworks

    10/27/2021, 5:31 PM
    Realtime not working
  • a

    aixoniarutad

    10/27/2021, 6:07 PM
    Do Policies work on Views? I have a SELECT policy protecting my organizations_users table, but calling my View does not seem to honor the policy. Any ideas?
  • k

    keknal

    10/27/2021, 6:34 PM
    Is there an easy way to debug performance of RLS policies? My team has somehow managed to make a lookup of a table with 5 rows take >3s.
    s
    k
    • 3
    • 7
  • b

    braedenf

    10/27/2021, 6:37 PM
    Supabase returns a JWT when you use the authentication functions. You can then check if the JWT is valid on an endpoint and then return your own cookie as a response and redirect if necessary. I'm new to Supabase but I think this is how it works.
  • a

    AirDiamond

    10/27/2021, 10:12 PM
    I'm a newbie here, so please be gentle. I'm trying to create a stored function that updates one field value based on a string match in another. I'm not having any luck even figuring out the syntax to use to access a field from the stored function. I just keep getting errors in the function editor. I feel like if I could see a few examples of stored procedures doing something simple, I might be able to figure it out. Thanks for any help you can offer!
  • g

    garyaustin

    10/27/2021, 10:19 PM
    When I have been trying to figure out my procedure code I mainly google search Postgres for the topic (like triggered function, stored procedures, etc. As there are lots of examples out there for almost anything.
  • a

    AirDiamond

    10/27/2021, 10:22 PM
    Thanks, Gary. I tried that, but I feel like there must be something different in the Supabase procedure editor that is causing all sorts of errors. Like maybe it doesn't want to see the "CREATE OR UPDATE..." line. I don't know. This is why I'm hoping to see something that a Supabase user knows works.
    g
    • 2
    • 2
  • g

    garyaustin

    10/28/2021, 12:45 AM
    Empty Filters
  • k

    Kevin Tale

    10/28/2021, 7:57 AM
    Hi! Is there any way to make the magic link redirect to my website depending on the environment it was send from or something? In Auth -> Settings I've setup "Site URL" to be my prod URL, but how can I work it out if I want to work with several environments and authenticate with magic link?
  • h

    HarryET

    10/28/2021, 8:36 AM
    As an option you can set
    redirectTo:
1...119120121...316Latest