Go SQL Comparison (squirrel, raw queries, sqlc and sqlx)

Sdílet
Vložit
  • čas přidán 12. 11. 2023
  • In this video, you'll learn the pros and cons of 4 different ways to interact with an SQL database in Go, by comparing squirrel vs raw queries vs sqlc vs sqlx.

Komentáře • 24

  • @daviddarfdas
    @daviddarfdas Před 3 měsíci +1

    Awesome explanation and amazing seeing examples for each library. Thank you.

    • @webdevfuel
      @webdevfuel  Před měsícem

      Thank you, I appreciate you watching. Glad it was helpful to you! 🙏

  • @jorgeandresnumamendoza258
    @jorgeandresnumamendoza258 Před 2 měsíci +1

    sqlc is my favorite, because has the highest performance (my benchmarks). I use it with a million users in mysql and postgres. You also have more control over your queries since you write them by hand. Good video!!! Thank you.

    • @arilson.santos
      @arilson.santos Před 2 měsíci +1

      Does it work well with N+1 queries? (for two or more structs)

    • @webdevfuel
      @webdevfuel  Před měsícem +1

      Thank you for sharing your experience! I've actually been using sqlx or the std library more, since I've found I had to modify the sqlc code for some edge cases. But if it works for you, that's what's important!! 😊

  • @Ohhimark100
    @Ohhimark100 Před 2 měsíci +1

    Thanks! That was very insightful.

    • @webdevfuel
      @webdevfuel  Před měsícem +1

      Thank you very much! I'm really glad it was insightful to you! 🙏

  • @JohnathanHendrix
    @JohnathanHendrix Před 7 měsíci +3

    Great video.

  • @diehenne
    @diehenne Před 7 měsíci +2

    thanks!

    • @webdevfuel
      @webdevfuel  Před 7 měsíci

      I'm glad it was helpful! Thanks for watching!

  • @lokeshahuja1885
    @lokeshahuja1885 Před 3 měsíci +1

    Very nice explanation, Can you please provide all the code snippets examples you have used.

    • @webdevfuel
      @webdevfuel  Před měsícem

      I don't think I have the code snippets publicly available, but I'll try to find them and update the description with the link to the repo! Thank you for watching! 🙏

  • @theofulis
    @theofulis Před 5 měsíci +1

    What application is that, that you using for the notes?

  • @neilmedina997
    @neilmedina997 Před 5 měsíci +2

    sqlx it is. sql proficiency , control and gigachad points.

    • @webdevfuel
      @webdevfuel  Před 5 měsíci

      I agree, sqlx is probably my favorite choice too!

  • @BarakaAndrew
    @BarakaAndrew Před měsícem +1

    sql injections using sqlx? lol not true

    • @webdevfuel
      @webdevfuel  Před měsícem +1

      If you build the query manually, yes. I said in the video that it's a possibility, but not if you build the query in the correct way (e.g. with question marks and the values as arguments).

  • @Christo6020
    @Christo6020 Před měsícem +1

    The language is called Go, not Golang.

    • @webdevfuel
      @webdevfuel  Před měsícem

      Sure, but it's referred to as Golang all the time so it's fine either way.

  • @Tay74514
    @Tay74514 Před 7 měsíci +1

    Thank you for sharing this. I can only imagine the analysis that went into sorting the pros and cons. Thank you again for speeding out thinking cycle up 🫡