PricingBlog

delete row in supabase

  • petershaw99-1265353107752222720

    PeterShaw

    1 year ago

    I want to set up an api to delete a row in supabase. Through Andreas to do list video I learned how to set up a read and insert api and I just "copied" the insert api but set it from Insert to Delete.

    supabase documentation says something about "some_column=eq.someValue' ". Can you help me to understand where to put this in the api connector?

    Thank you
    1265353107903090850-toddle.PNG
    1265353108368920678-toddle1.PNG
  • Tod-1265353110784573491

    Tod

    1 year ago

    Great energy @PeterShaw! Your continuous contribution to the toddle Community just made you advance to Community Level 2!
  • lucasg-1265354990390743070

    Lucas G

    1 year ago

    This is the sample DELETE request from supabase docs:
    curl -X DELETE 'https://<your-subdomain>.supabase.co/rest/v1/<your-table>?some_column=eq.someValue' \
    -H "apikey: SUPABASE_KEY" \
    -H "Authorization: Bearer SUPABASE_KEY"
  • Here the some_column=eq.someValue would the Primary Key for the table
  • You'd set this part up in the Queries parameters
  • For example: id=eq.1
  • You can use the concat node to put together the eq.1 part
  • Does that make sense?
  • building_stuff-1265384480580046992

    Janis

    1 year ago

    Like Lucas said: Under Queries add the following - where I put uuid you put the id of the row you want to delete
    1265384480323928184-image.png
  • Tod-1265384482911944785

    Tod

    1 year ago

    Great energy @Janis! Your continuous contribution to the toddle Community just made you advance to Community Level 5!
  • petershaw99-1265402018000932975

    PeterShaw

    1 year ago

    Thanks @Janis @Lucas G

    at least the API seems to work. But the workflow does not...
    1265402017417789510-image.png
    1265402017824899263-image.png
  • building_stuff-1265404449279574140

    Janis

    1 year ago

    @PeterShaw You’re making a get request, change that to delete and it should work
    👍1