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

    Donnager

    01/27/2022, 10:16 PM
    hi everyone, has anyone tried integrating prisma with supabase? specifically the auth functions that supabase exposes, can prisma see those? getting this error when adding a trigger to a migration:
    Copy code
    db error: ERROR: schema "auth" does not exist
    in this github thread it looks like someone asks the same question and did not get a response / was asked to go to prisma: https://github.com/supabase/supabase/issues/1502, conversely in prisma's slack someone else asked as well and the response was to ask around here, but in the discord search i didnt see anything
  • r

    Rortan

    01/27/2022, 10:35 PM
    Hey, im fetching some videos from a storage bucket, is there any way i can fetch them by data order? since im lazyloading and fetching them on the go i can't order them client side
    g
    • 2
    • 6
  • s

    Scotty

    01/27/2022, 10:43 PM
    Hey, why doesn't this log the user? Instead, it seems to be refreshing the page after login and the console clears
    Copy code
    js
        const { user, session, error } = await supabase.auth.signIn({
          // provider can be 'github', 'google', 'gitlab', or 'bitbucket'
          provider: "github",
        });
    
        console.log(user);
  • g

    garyaustin

    01/27/2022, 11:11 PM
    Have you done all this https://supabase.com/docs/guides/auth/auth-discord ?
  • s

    Scotty

    01/27/2022, 11:12 PM
    yea
  • s

    Scotty

    01/27/2022, 11:12 PM
    The login is working, but I'm not able to log the user information or route the user somewhere after
  • s

    Scotty

    01/27/2022, 11:12 PM
    It just refreshes the page and wipes everything
  • k

    KazuYagami

    01/28/2022, 2:36 AM
    Is there any way to monitor the size of data transfer of database in a month? I am worried that I"ll reach the monthly transfer limit without noticing.
  • m

    moein

    01/28/2022, 7:33 AM
    Hello supabase team Some time ago I released cavapi.com on producthunt(https://www.producthunt.com/posts/cavapi) and I just found out I get xp for that 😄
  • v

    VincentThomas

    01/28/2022, 9:30 AM
    Hi! Is there any way you can have a combination of two columns in the database unique? For example if i have a table with
    id
    and
    userId
    as columns. I don't want
    userId
    to be unique and i don't want
    id
    to be unique. But the combination between them to be unique. Can that be done?
  • s

    stabacco

    01/28/2022, 10:40 AM
    Yes, you can have a unique constraint that spans multiple columns as described here: https://stackoverflow.com/questions/14221775/in-postgresql-force-unique-on-combination-of-two-columns
  • v

    VincentThomas

    01/28/2022, 10:40 AM
    Is there a 'supabase' way of doing it?
  • v

    VincentThomas

    01/28/2022, 10:42 AM
    I mean like in the ui?
  • s

    stabacco

    01/28/2022, 10:46 AM
    you should be able to do through the sql editor tab:
    Copy code
    ALTER TABLE tablename ADD CONSTRAINT constraintname UNIQUE (userid, id);
  • r

    Richie

    01/28/2022, 10:51 AM
    Hey everyone! I need to transfer a Supabase DB to someone else, what's the best way of doing this? Is there a way for me to export my Supabase DB, then import into their Supabase DB?
    s
    • 2
    • 1
  • v

    VincentThomas

    01/28/2022, 10:54 AM
    Thanks!
  • d

    dmytro.eth

    01/28/2022, 10:54 AM
    Hello peeps, what the best way to handle prod and development environments in Supabase? Just create a separate project for different environment and have the database table synced?
    s
    • 2
    • 3
  • v

    VincentThomas

    01/28/2022, 10:55 AM
    I don't think having the database synced is a good idea
  • d

    dmytro.eth

    01/28/2022, 10:56 AM
    I was referring about having same columns/relations, not documents
  • v

    VincentThomas

    01/28/2022, 10:56 AM
    Sorry for missunderstanding
  • s

    stabacco

    01/28/2022, 10:57 AM
    one way i did it in the past is through pgadmin connected to the postgresql supabase instance, there you can dump the db to a file and restore it by loading that same file on the new instance
  • v

    VincentThomas

    01/28/2022, 10:59 AM
    For some reason the query doesn't work. it just says
    could not create unique index "index_name"
    . i don't have any other indexes. One of the columns is a foreign key. is that okay? And none is unique. Am i doing something wrong?
  • v

    VincentThomas

    01/28/2022, 11:01 AM
    Does the table need to be empty?
  • s

    stabacco

    01/28/2022, 11:02 AM
    no there's no need for it to be empty, what command did you issue?
  • v

    VincentThomas

    01/28/2022, 11:03 AM
    @User It worked now, but i needed to wipe the table 🤔.
    ALTER TABLE invites ADD CONSTRAINT unique_invites UNIQUE (group_id, owner_id);
  • s

    stabacco

    01/28/2022, 11:04 AM
    it's possible that some of the entries were violating the constraint, that'd be my guess
  • v

    VincentThomas

    01/28/2022, 11:05 AM
    Maybe, and the data doesn't really matter. Thanks for the help!
  • d

    dmytro.eth

    01/28/2022, 11:40 AM
    Is there a way to create tables without using GUI?
  • v

    VincentThomas

    01/28/2022, 12:20 PM
    Yes, in the SQL editor to the left
  • o

    oscar_gallog

    01/28/2022, 12:45 PM
    Hey Community! How are you doing? I have a question. Do you have any example using Supabase with user roles like, admin, reader, writer, etc and the policies for them on the tables? I'm watching some videos about it but so far the examples are things like: "It is logged?" and that's way too simple. Thanks in advance.
1...206207208...316Latest