The Lost Art of plpgsql - Robert Treat

Поделиться
HTML-код
  • Опубликовано: 26 окт 2024

Комментарии • 8

  • @philheathslegalteam
    @philheathslegalteam 2 года назад +4

    Now that supabase has been released, stored procedures will really make a big comeback.

    • @friedrichwaterson3185
      @friedrichwaterson3185 Год назад +2

      That's why I'm here lol

    • @greendsnow
      @greendsnow Год назад

      I'm supa annoyed. what is this thing. it looks like SQL, but it's not.

    • @philheathslegalteam
      @philheathslegalteam Год назад

      @@greendsnow It is pure SQL fronted by an api gateway. When you're writing stored procedures you're writing SQL, then calling them via RPC using PostgREST

  • @michaellewis6569
    @michaellewis6569 5 лет назад

    At around 19 minutes, v_rentals will never be 0, right? It would be NULL or some value 1 or greater because of the where clause. You would need to move the WHERE clause to a FILTER clause on the count function, or use IF NOT FOUND instead of checking if the count is 0. Maybe I am missing something.

    • @BotondZalaiRuzsics
      @BotondZalaiRuzsics 2 года назад

      Count never returns null, it returns 0.

    • @michaellewis6569
      @michaellewis6569 2 года назад

      @@BotondZalaiRuzsics true. I had a brain hiccup and was thinking that if you don't have any rows in the set at all, it would not return anything. Thanks for calling that out.