https://supabase.com/ logo
Join Discord
Powered by
# off-topic
  • e

    Ethanxyz

    05/22/2023, 6:27 PM
    Is there a way to export a SQL schema for a Supabase Database from the UI ?
  • r

    Razoth

    05/22/2023, 7:31 PM
    no, cli is probably your fastest option
  • Hello everyone can someone here help me
    a

    ArjunXD

    05/23/2023, 8:32 AM
    Hello everyone can someone here help me get started with open source contribution I would like to be an active contributor to the Supabase repo,I am a final year undergrad student with some development experience as an intern and freelance in the past and would like to expand my knowledge while serving at the same time
    r
    • 2
    • 8
  • Hi I have an account on supabase com but
    n

    naz

    05/23/2023, 10:09 AM
    Hi, I have an account on supabase.com but I have loggedin or signed up with GitHub How to do if I want to setup a password to start a paid account ?
    n
    • 2
    • 7
  • s

    silentworks

    05/23/2023, 2:17 PM
    If you are running into issue of logs in the dashboard not loading we are aware of the issue and are currently investigating it. https://status.supabase.com/incidents/qwwr2ftwsy03
  • g

    garyaustin

    05/23/2023, 10:45 PM
    https://github.com/GaryAustin1/RLS-Perfomance/blob/main/README.md Readme has details on tests and ways to improve your RLS performance and link to backup data. Pretty much if you have, or will have, tables with over 10K rows worth a look.

    https://cdn.discordapp.com/attachments/839993398554656831/1110700140714545293/image.png▾

  • a

    ArjunXD

    05/24/2023, 3:21 PM
    new to open source contribution, made a pull request is there any specific branch naming convention to raise one as I couldn't find anything related to it in the contribution guide
  • d

    drilkmops

    05/24/2023, 8:10 PM
    Someone yell at me and tell me why this would be bad practice. I'm using Prisma to generate these schemas, and using supabase auth. This
    user
    model is the public schema, the
    users
    model is the auth schema.
    Copy code
    model user {
      // This user id is from the auth schema, not the public schema.
      user       users  @relation(fields: [id], references: [id])
      id         String @id @db.Uuid
      email      String
      first_name String
      last_name  String
    
      // ## Defined Relationships
      // ...removed
    
      @@schema("public")
    }
  • j

    Jinni

    05/25/2023, 2:32 AM
    is using the js sdk, does upsert require the id (primary key)? What if it is new data and it still does not have a primary key?
  • j

    Jinni

    05/25/2023, 2:49 AM
    Can you give more details of how does it work? I am confused where should I put the "using" and "with check" parts
  • u

    <hmmhmmhm/>

    05/25/2023, 2:50 AM
    Yes you can just paste that into the with check part.
  • j

    Jinni

    05/25/2023, 2:51 AM
    I mean. Where should I put it in the createPolicy function? or is it "combined", as long as I return a boolean
  • u

    <hmmhmmhm/>

    05/25/2023, 2:53 AM
    aha i see, let me guess...
  • u

    <hmmhmmhm/>

    05/25/2023, 2:54 AM
    first, you need to write your condition in "createPolicy".
  • u

    <hmmhmmhm/>

    05/25/2023, 2:55 AM
    after doing that, you can click convert button, then it converted as sql condition
  • u

    <hmmhmmhm/>

    05/25/2023, 2:56 AM
    and you need go to the supabase policy dashboard, create policy, and paste sql condition as "with check" part
  • u

    <hmmhmmhm/>

    05/25/2023, 2:57 AM

    https://cdn.discordapp.com/attachments/839993398554656831/1111125855658324018/image.png▾

  • u

    <hmmhmmhm/>

    05/25/2023, 2:57 AM
    When you first enter, it should look like this: enter the name of the table you want to modify in the red-lined area.
  • u

    <hmmhmmhm/>

    05/25/2023, 2:58 AM

    https://cdn.discordapp.com/attachments/839993398554656831/1111126097015345162/image.png▾

  • j

    Jinni

    05/25/2023, 2:58 AM
    I see. so it is just generating the "conditions" no the whole policy itself
  • j

    Jinni

    05/25/2023, 2:59 AM
    Am I doing this right? It doesn't seem to save

    https://cdn.discordapp.com/attachments/839993398554656831/1111126274056921228/image.png▾

  • j

    Jinni

    05/25/2023, 2:59 AM
    I just pasted the generated code
  • u

    <hmmhmmhm/>

    05/25/2023, 3:01 AM
    Um... it doesn't auto-complete the entire Policy SQL statement, this is something I'm thinking about now,,,, Do you always manage the entire RLS Policy in a full query statement? the way I was thinking was to do it via GUI in the Policy field of the Supabase Dashboard.
  • u

    <hmmhmmhm/>

    05/25/2023, 3:01 AM
    Can you copy that syntax and send it to me so I can check for syntax errors?
  • j

    Jinni

    05/25/2023, 3:03 AM
    Copy code
    CREATE POLICY "test" ON "public"."profiles"
    AS PERMISSIVE FOR SELECT
    TO public
    USING (boolean as $$ function createPolicy(cb) { cb({ row: globalThis, function: globalThis, auth: globalThis.auth, plv8: globalThis.plv8 }); } return createPolicy(function(context) { return true; }); $$ language plv8;)

    https://cdn.discordapp.com/attachments/839993398554656831/1111127400726679622/image.png▾

  • j

    Jinni

    05/25/2023, 3:05 AM
    I do but doing this via gui should be fine for now. I just assumed it will generate the policy. My whole workflow is we commit the policy via code and "upload" it via cli
  • g

    garyaustin

    05/25/2023, 3:05 AM
    It is too late now, but please use the thread feature....
  • lol ok
    u

    <hmmhmmhm/>

    05/25/2023, 3:05 AM
    lol ok
    j
    • 2
    • 5
  • j

    Jinni

    05/25/2023, 3:05 AM
    sorry @garyaustin 😅
  • u

    <hmmhmmhm/>

    05/25/2023, 3:06 AM
    i didn't catch that
1...388389390391392Latest