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

    jason-lynx

    09/22/2021, 6:34 AM
    yeah then the pg_dump option and grant permissions would work
  • f

    fp

    09/22/2021, 9:52 AM
    Does anyone know how I would export a 400MB (2 million row) table in Supabase? I can't find any way to save it (or a subset of it) to CSV. The table view only allows me to export 1000 rows at a time.
  • k

    KKH

    09/22/2021, 10:17 AM
    I'm rewriting a webRTC app that earlier had a socket.io node server to handle signalling and other user triggered events but i now want to try using supabase to get rid of my node backend completely. I have a concept of rooms where every user that enters it creates a subscriptions ie
    supabase.from('room_events:some_condition').on('*') => { //do stuff }
    The part i'm struggling with is to notify all other room users when someone leaves the room. I have tried tried to do this from the client by firing a
    supabase.rpc('user_left')
    on
    window.beforeunload
    and when room component unloads but i feel this feels too flaky and won't cover browser crash etc. With my previous approach i emitted broadcast message to all room users from the server on a socket
    disconnect
    event. Is something similar possible with supabase? I'm thinking Postgres could have these capabilities but i'm quite new to it so have just started exploring it.
  • t

    Tessellated

    09/22/2021, 10:39 AM
    https://supabase.io/docs/reference/javascript/select#return-data-as-csv You can go to project settings -> api and increase max rows returned, but I'm not sure if it's better than retrieving data in chunks.
  • u

    user

    09/22/2021, 10:59 AM
    hello! i am trying to upsert a series of documents by a specific key. I have a key
    id_internal
    which is a string, and i want it to be the base for the upsert matching. However I assume the upsert method matches the documents by the default int8
    id
    key, which i don't have in the documents i want to upsert (i leave supabase generating them, and the incoming data i get for the upsert is scraped from a remote source). Any way i can choose which field to match against here ?
  • t

    Tessellated

    09/22/2021, 11:09 AM
    https://postgrest.org/en/v8.0/api.html#upsert add ?on_conflict=column_name and Prefer: resolution=merge-duplicates / ignore-duplicates header depending on what u need
  • t

    Tessellated

    09/22/2021, 11:09 AM
    id_internal should be unique for that to work
  • t

    Tessellated

    09/22/2021, 11:18 AM
    https://supabase.io/docs/reference/javascript/upsert#upserting-into-tables-with-constraints prolly same thing in js client
  • m

    Mew

    09/22/2021, 11:59 AM
    Do you have any offers for startups?
  • u

    user

    09/22/2021, 12:14 PM
    thanks!
  • m

    Marky

    09/22/2021, 2:18 PM
    Service account shouldn't be limited by max rows
  • v

    Vik

    09/22/2021, 7:20 PM
    Is there a resend SMS token function?
  • v

    Vik

    09/22/2021, 8:45 PM
    Sorry, one more follow-up question if anyone knows. If I use SMS and password to signup users, how does a user reset their password in case it is forgotten? I'm not seeing a reset via SMS or anything only email.
  • a

    AlexM

    09/22/2021, 11:39 PM
    Hello! I'm trying to make a GET request against a table in my database but am having trouble identifying what the route would be. Can anyone point me in the right direction?
  • j

    jon

    09/22/2021, 11:41 PM
    hey all, I'm running a select query that includes columns from a foreign table. the foreign table colums are returned as json under one column. I'd like them to be their own columns. Any help how to do this with
    .csv()
    ? example resp:
    Copy code
    organization_id
    "{""name"":""Amperity"",""domain"":null}"
    desired resp:
    Copy code
    organization_name, organization_domain
    "Amperirty", "null"
  • j

    jason-lynx

    09/23/2021, 4:08 AM
    in your supabase dashboard, click on the API section, select the table you're interested in, then select 'bash' around the top right area to get the curl command
  • m

    Marky

    09/23/2021, 9:15 AM
    has anyone been able to successfully pgdump their database?
  • b

    bh

    09/23/2021, 10:15 AM
    yes, I changed the permissions of the postgres user to allow backup of all the schemas I needed
  • b

    bh

    09/23/2021, 10:16 AM
    I think postgres user by default has the backup role that allows use of pgdumpall, but with pgdump you need to grant the correct permissions
  • m

    Marky

    09/23/2021, 10:16 AM
    What specific permissions you change?
  • m

    Marky

    09/23/2021, 10:17 AM
    I get permission errors on system sequences.
  • b

    bh

    09/23/2021, 10:17 AM
    grant all privileges on ....
  • b

    bh

    09/23/2021, 10:18 AM
    GRANT USAGE ON ALL SEQUENCES IN SCHEMA foo TO mygrp;
  • b

    bh

    09/23/2021, 10:18 AM
    see https://stackoverflow.com/questions/10352695/grant-all-on-a-specific-schema-in-the-db-to-a-group-role-in-postgresql
  • m

    Marky

    09/23/2021, 10:19 AM
    Shouldn’t Postgres already have. The permissions?
  • b

    bh

    09/23/2021, 10:31 AM
    did not seem to - anyway you will need to grant permissions on tables that you created on your own schemas anyhow
  • b

    bh

    09/23/2021, 10:32 AM
    for best security its usually best to not have all tables in the public schema
  • s

    silentworks

    09/23/2021, 10:55 AM
    Be very careful with these changes
  • s

    stibbs

    09/23/2021, 10:58 AM
    Is there a supabase equivalent for https://firebase.google.com/docs/admin/setup?
    s
    • 2
    • 7
  • m

    Marky

    09/23/2021, 3:02 PM
    Which things.
1...939495...316Latest