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

    Tjol

    08/28/2021, 10:21 AM
    Nice! Great to hear!😊 But does Supabase have api methods for e.g sum, avg and group by? If not, is it correct that you can write custom SQL queries to your db instead, to achieve Sum, Group By etc.
  • h

    HorseShoe

    08/28/2021, 12:20 PM
    It doesn't have separate methods for that from what I know u can just them inside select function and it wud work
    Copy code
    supabase.from("cities").select(" max (population)")
  • h

    HorseShoe

    08/28/2021, 12:21 PM
    U can pass the count type estimated, exact, etc. And head in the options after the string in select fn
  • p

    Poypoypoy

    08/28/2021, 1:25 PM
    anyone deployed supabase react project in aws. can i have your suggestion youtube tutorial
  • p

    Peanut

    08/28/2021, 1:51 PM
    Hey all. I made a little NPM module to bridge Firebase Functions with Supabase HTTP triggers. Would love some feedback https://www.npmjs.com/package/firebase-supabase-function-bridge
  • p

    Peanut

    08/28/2021, 1:51 PM
    (it basically makes sure there is a special API key HTTP header when calling your functions and it automatically inserts each HTTP trigger for each function)
  • b

    burggraf

    08/28/2021, 5:47 PM
    https://github.com/burggraf/SupabaseLogQuery I rewrote this today - hope you find it useful.
  • m

    MDobs

    08/28/2021, 9:07 PM
    hey there, is there a way to send data from the HTTP request of Function hooks? As far as I can see from the UI only url params are supported. What about sending JSON?
  • h

    Hal

    08/29/2021, 6:12 AM
    Is the storage policy changed? I remember I have to add select policy manually to make files public even the bucket is public. But now the files are public as default if you create a public bucket.
  • h

    Hal

    08/29/2021, 9:20 AM
    Hi everyone, I got an error when using upsert. This error means I have to give all fields right? But what if I just want to update one field? It doesn't support or something wrong with my code? My code is like:
    Copy code
    js
    await supabase
        .from('design_files')
        .upsert({ id: 'c9a68fc0-757a-4556-b339-659c19b551fe', name: 'Heron' })
  • c

    cataxcab

    08/29/2021, 10:15 AM
    upsert = update if already present, insert if not present. There are 3 columns: `id, name, owner`; all 3 mandatory. Case 1: Entry is already present. It updates the row with the new
    name
    , leaving
    owner
    unchanged. Case 2: Entry is not present. It tries to insert a new row with that
    name
    and `ID`; but
    owner
    is a required field, so insert will fail.
  • c

    cataxcab

    08/29/2021, 10:17 AM
    So you need to specify
    owner
    for
    upsert
    to work, or else
    insert
    (case2) will fail. If you're okay with it failing, just use
    update
    insert of
    upsert
    .
  • h

    HorseShoe

    08/29/2021, 10:54 AM
    like i asked before how do i implement rate limiting ?
    s
    b
    +5
    • 8
    • 212
  • h

    HorseShoe

    08/29/2021, 10:55 AM
    do i have to create a new table for that and integrate it into rls maybe?
  • s

    Scott P

    08/29/2021, 12:43 PM
    Postgres rate limiting
  • h

    Hal

    08/29/2021, 1:36 PM
    Thanks @User , I'll use update and insert.
  • k

    kelvin.pompey

    08/29/2021, 2:45 PM
    Greetings everyone. I am having a self hosting issue. I was able to get the project running based on the docker configuration with the default settings. I then changed the JWT secret and the anon and service keys and now I am getting an 'Invalid authentication credentials' error. I changed the keys in dockerfiles/kong/kong.yml and in the environment section of docker-compose.yml. I noticed the self hosting guide didn't mention changing that but I figured the keys needed to be the same. Is there something that I am missing?
  • s

    Scott P

    08/29/2021, 4:29 PM
    Make sure you've also updated the following env vars for the containers: -
    supabase-rest
    container:
    PGRST_JWT_SECRET
    -
    supabase-realtime
    container:
    JWT_SECRET
    -
    supabase-auth
    container:
    GOTRUE_JWT_SECRET
    -
    supabase-storage
    container:
    PGRST_JWT_SECRET
    Editing them, and then restarting/redeploying the individual containers should fix the issue
  • k

    kelvin.pompey

    08/29/2021, 4:41 PM
    @User The JWT_SECRET is read from the .env file for those containers so they all should be using the updated value.
  • p

    phantoxe

    08/29/2021, 5:06 PM
    Hi Juuun your issue is simple... You have null fields and in your table you check the NOT NULL CHECKBOX... Edit your table settings πŸ˜‰
  • c

    cataxcab

    08/29/2021, 5:31 PM
    That's breaking the data model!
  • p

    phantoxe

    08/29/2021, 5:37 PM
    Yes... he need check if the fields can be null as well πŸ™‚
  • k

    kelvin.pompey

    08/29/2021, 5:56 PM
    Could this be a caching issue? I shutdown down the containers, deleted the folder and did a fresh clone of the repository without changing anything and I am getting the same error.
  • s

    samefold

    08/29/2021, 7:12 PM
    Is anyone using Supabase with Next.js? Do you prefer to implement auth on the server side or the client side (and why)? I've read tutorials doing it both ways but I don't really see any advantage to the server-side method, just increased latency + more limited deployment options. I'd love to hear pros/cons of doing it this way.
  • k

    kennethcassel

    08/29/2021, 7:57 PM
    We use it with Next.js and use a combination of both server and client side. Somethings we use the service role key for inserting data and that stays strictly on the server side where users can’t grab the key. We use the supabase client on the client side with the anon key + appropriate row level security policies in place
  • s

    samefold

    08/29/2021, 8:17 PM
    Thanks, that's helpful 😊
  • s

    samefold

    08/29/2021, 8:20 PM
    Also, I've been searching about whether it's possible to impose rate limiting with Supabase and noticed a few people wondering the same but I couldn't find any conclusive answers. Would it be possible to impose a constraint on login attempts without having to involve a backend?
  • t

    tinjaw

    08/29/2021, 10:11 PM
    This is awesome >>> I wanted to use micro-functions/FaaS, but supabase functions are alpha, and I need stable. So I figured, Ah ha! I'll use Cloudflare workers. And so I get an account and look for a javascript example. And I see "Build data-driven applications with Workers and PostgreSQL", so I get excited. That looks good. I can probably adapt that to Supabase. Well, no..... Because... . . The example uses Supabase https://developers.cloudflare.com/workers/tutorials/postgres
  • t

    tinjaw

    08/29/2021, 11:07 PM
    I am stuck though on one thing. I cannot determine the URL I am supposed to use to connect to postgrest
  • t

    tinjaw

    08/29/2021, 11:37 PM
    I am starting to think the example is outdated.
1...919293...392Latest