Create PostgreSQL Functions with Supabase

Поділитися
Вставка
  • Опубліковано 13 гру 2024

КОМЕНТАРІ • 71

  • @konstantinonassis7015
    @konstantinonassis7015 25 днів тому +2

    1:39 duuuuude those next 15 seconds I did not expect at all, that was brilliant

  • @SebastianGrantElKiva
    @SebastianGrantElKiva 4 місяці тому +4

    As an Australian who started their journey producing rap songs and now writes apps, I find Mr. Myers an appropriate muse. Supabase is great!

  • @sunstryder
    @sunstryder Рік тому +11

    Fantastic tutorial, didn't expect to be cracking up looking at table rows lool

  • @ofeenee
    @ofeenee 2 роки тому +19

    You should do more and more videos of supabase. I enjoy and learn so much of everything you demo. Thank you very much. Really.

  • @cesarsfalcao
    @cesarsfalcao 4 місяці тому

    First time using PostgreSQL with Supabase with just Excel as prior knowledge, and the AI assistant helped me create the queries and even actions from me! I'm loving it!

  • @dramos287
    @dramos287 2 роки тому +1

    I had no idea postgres could do all of this, awesome video, thank you !

  • @SoniaAcosta-yt7qr
    @SoniaAcosta-yt7qr 8 місяців тому

    Love that you explained while other videos ive seen show how to set a function up they didnt explain what it actually does or mean. Thank you!

  • @shaunregenbaum
    @shaunregenbaum 3 роки тому +7

    I was looking for something like this just a couple weeks ago! Thanks for the video, would love an even more in depth follow up.

    • @JonMeyers
      @JonMeyers 3 роки тому

      We are putting together a series on postgres functions - check out this playlist which will be updated weekly: ua-cam.com/play/PL5S4mPUpp4OtkMYxAxNpEuuDQuI2pWF3-.html

  • @rembautimes8808
    @rembautimes8808 Рік тому +1

    This video is really good , and I wrote my first plpgl function this afternoon albeit in pgadmin. Helps explain stuff I couldn’t grasp

  • @FlorinPop
    @FlorinPop 3 роки тому +4

    Great tutorial! Thank you!

    • @JonMeyers
      @JonMeyers 3 роки тому

      Thanks Florin! Glad you enjoyed it!

  • @rydmike
    @rydmike 3 роки тому +2

    Great video! Clear and to the point, keep ‘em coming! 👍💙

    • @JonMeyers
      @JonMeyers 3 роки тому

      More functions related material coming each week for in this playlist: ua-cam.com/play/PL5S4mPUpp4OtkMYxAxNpEuuDQuI2pWF3-.html

  • @salihcagdasderya1144
    @salihcagdasderya1144 2 роки тому +2

    really amazing video you should link this to the docs :)

  • @drancerd
    @drancerd Рік тому

    WOOOOOO! It's awesome and powerful! i need a full curse about EdgeFunctions, plpgsql and triggers.

  • @eliasalerno8942
    @eliasalerno8942 3 місяці тому

    Very well explained! Thank you so much :))

  • @swyxTV
    @swyxTV 2 роки тому +1

    love the little jokes at the start!

  • @mysterytriangle6062
    @mysterytriangle6062 3 роки тому +1

    that was fun informative and right to the point, thanks Jon for your efforts.

    • @JonMeyers
      @JonMeyers 2 роки тому

      Awesome! Glad you enjoyed it! 🙌

  • @TomasJansson
    @TomasJansson Рік тому

    I'm running the local development instance and can't find the "New query" button, or the search field, in the SQL editor. Is that a known version "issue" or lack of functionality in the local instance?

  • @ZyncInteractive
    @ZyncInteractive 2 роки тому +3

    Great tutorial, thanks so much for this. Can you please update the description as you said about calling the functions from javascript?

  • @albertodeagostini6143
    @albertodeagostini6143 3 роки тому +2

    This looks super useful combined with triggers and client sdk

    • @JonMeyers
      @JonMeyers 3 роки тому +1

      Exactly! We have a series of videos covering just these topics coming over the next few weeks. We will be adding them to this playlist as we go: ua-cam.com/play/PL5S4mPUpp4OtkMYxAxNpEuuDQuI2pWF3-.html

    • @albertodeagostini6143
      @albertodeagostini6143 3 роки тому

      @@JonMeyers nice work guys

    • @JonMeyers
      @JonMeyers 2 роки тому +1

      @@albertodeagostini6143 The triggers and client sdk videos are now live 👍

    • @albertodeagostini6143
      @albertodeagostini6143 2 роки тому

      @@JonMeyers Thanks man

  • @Shortly8908
    @Shortly8908 Рік тому

    Reaaaally great tutorial. Thank you very much!

  • @randomtimessomehow
    @randomtimessomehow Рік тому

    3:09 how can we create a function using javascript?

  • @zebnastien5085
    @zebnastien5085 6 місяців тому

    Hi, is there a way to sync Database Functions to files in a local git project so we can seamlessly use our favorite IDE? Let's say having a command for Supabase CLI to retreive functions?

  • @Supabase
    @Supabase  Рік тому

    More about Postgres Functions: supabase.com/blog/2021/07/30/supabase-functions-updates?MJZCCpCYEqk

  • @XinXinTax
    @XinXinTax Рік тому

    where can I review all the functions i have created ? thanks

  • @nabeel12310
    @nabeel12310 3 роки тому +1

    Thanks team for this great tutorial.

    • @JonMeyers
      @JonMeyers 3 роки тому +1

      Thanks Nabeel! Glad you enjoyed it!

  • @_aadilhassan
    @_aadilhassan 8 місяців тому

    loved these videos.

  • @mrrolandlawrence
    @mrrolandlawrence 2 роки тому

    amazing stuff. as mostly a dba i really groan when logic is not done in the backend. im guessing that functions are the preferred way of integrating PLPGSQL rather than stored procedures?

  • @JuanDuran85
    @JuanDuran85 2 роки тому +1

    Excellent thanks. One question, how can a function with parameters be applied as an array with n objects inside? like this:
    [
    {"abc":111, "xyz":"all"},
    {"abc":222, "xyz":"not"},
    {"abc":333, "xyz":"yeah"}
    ].
    The questions is because in your case you use single parameters, but I have no idea how to use an array as a parameter in the function. Can you help me. Thanks

    • @mathias2860dk
      @mathias2860dk 2 роки тому

      Did you solve this problem? I am having the same problem

  • @PostMapping
    @PostMapping 19 днів тому

    Thank you! I signed up

  • @rahulagarwal968
    @rahulagarwal968 Рік тому

    What is create or replace view ? What are views in supabase what it does ?

  • @BrunoMateusMG
    @BrunoMateusMG 2 місяці тому

    Great example, but I'm trying to find an example where an array of uuids is used as parameters into a select "where" clause, but can't seem to find it anywhere. Anyone knows how to?
    I've added the argument as 'uuid[]', and the function as
    `
    begin
    select subproduct, count(*)
    from subproducts_daily_data
    where subproduct = any(subproducts::uuid[])
    group by subproduct;
    end;
    `
    It always returns an error 42883, Operator does not exist: uuid = uuid[].

  • @neonsegaming3114
    @neonsegaming3114 2 роки тому +1

    So it's unavailable for self hosting?

  • @andim2772
    @andim2772 Рік тому

    How to push pg-functions from local to remote using cli?

  • @hago7568
    @hago7568 Рік тому

    Great tutorials! How would I return the output of a join between two tables?

  • @whereistheonering
    @whereistheonering 5 місяців тому

    Colleagues thought I was scrolling memes at work lmao

  • @dadicode
    @dadicode Рік тому

    How can I return the information in a JSON format from a table?

  • @dylanknight9206
    @dylanknight9206 2 роки тому

    Is there a way to share the SQL editor queries across a team of people?

  • @eskelCz
    @eskelCz 2 роки тому

    how do I return/throw a custom error from the function?

  • @seanfiinn9990
    @seanfiinn9990 Рік тому

    Can you write these functions in python and schedule them?

  • @CokyCokino
    @CokyCokino 2 роки тому

    How can I call this function from the frontend passing a parameter?
    Below Supabase > SQL Editor > Query, I created and tested my query and it's working fine.
    create or replace function get_males(gender_input text) returns setof heroes as $$
    begin
    return query select *
    from heroes
    where heroes.gender = gender_input;
    end;
    $$ language plpgsql;
    Call this function from the frontend, it's not working.
    ...
    const { data } = await supabase.rpc("get_males", "Male").select(*);
    ...
    Pls could you help me?
    Thks

    • @CokyCokino
      @CokyCokino 2 роки тому

      Solved. I'm doing an error calling rpc function
      let gender_input = "Male";
      const { data, error } = await supabase.rpc("get_males", {
      gender_input,
      });
      if (error) console.error(error);
      else console.log(data);

  • @reni_christian
    @reni_christian 11 місяців тому

    Awesome 🤩

  • @mahdihabibi1875
    @mahdihabibi1875 23 дні тому

    thank you

  • @planetmall2
    @planetmall2 2 роки тому

    Amazing!

  • @puvididdle
    @puvididdle 8 місяців тому

    times have changed, shots fired at rappers by a database tutorial

  • @low-codefanatic
    @low-codefanatic 8 місяців тому

    Did dj khaled dirty 😂😂

  • @mikericz1120
    @mikericz1120 3 місяці тому

    4:34

  • @amirarshiamirzaei710
    @amirarshiamirzaei710 7 місяців тому

    Oh the classic create whole database to undrestand you're neighbors instead of go chat with them that's real programer

  • @1ma4ighter
    @1ma4ighter 2 роки тому +2

    bruh the entertainment factor of these videos. . . why don't you just make videos on everything that I'm interested in like tesla turbines and generators and stuff?

  • @mohammedmehdi1940
    @mohammedmehdi1940 Рік тому

    like the humour

  • @mikericz1120
    @mikericz1120 3 місяці тому

    10:03

  • @parkerrex
    @parkerrex 10 місяців тому

    These videos are hilarious lol

  • @TheAabbccddee12345
    @TheAabbccddee12345 Рік тому

    another one had me laughing so hard

  • @simonswiss
    @simonswiss 2 роки тому +1

    99 problems 😅

  • @Mid.G.
    @Mid.G. Рік тому

    It is amazing that the gold standard language for relational databases, is still the ugliest most verbose language on the planet .. SQL

  • @code-maestro
    @code-maestro 2 роки тому

    🤣 another one

  • @greendsnow
    @greendsnow 2 роки тому +1

    wtf is this? am I going to learn sql to use SB?

  • @unpin8101
    @unpin8101 2 роки тому

    Yikes Kanye West, that aged poorly