Go - SQL Databases in Golang with the database/sql package

Sdílet
Vložit
  • čas přidán 6. 09. 2024

Komentáře • 55

  • @terrencemoore8739
    @terrencemoore8739 Před 9 dny

    Wouldve been cool to see you connect the db to a http server as well but this was very informative, thank you!

  • @PyroVox
    @PyroVox Před 4 měsíci +2

    Thanks for making this tutorial. I'm a beginner with Go and making a backend app; this video was precisely what I needed, presented clearly and concisely.

  • @alperaslan.
    @alperaslan. Před 5 dny +1

    I wish you have golang course on Udemy :) You have very clear explanation :) thx for the video .)

  • @seydinaoumarsamabaly1806

    You have the art of inspiring self-confidence in every programming langage I've seen on this channel. Incredible ! Thank you for all Master.

    • @bugbytes3923
      @bugbytes3923  Před rokem +2

      Thanks a lot for that, really nice comment mate - cheers!

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

    God I am loving this language, all tutorials i am finding are literally how I would want to to write my application.
    Connect to DB with 2 lines of code and create a table with raw SQL directly from your code! Yes please!!! 😍😍😍

  • @abessesmahi4888
    @abessesmahi4888 Před rokem +4

    Thank for this great content, next time please cover DB migrations, and ORMs.
    Thank you so much for your efforts.

    • @bugbytes3923
      @bugbytes3923  Před rokem +2

      Thank you - will do, thanks a lot for the suggestion + the comment!

  • @sternparadis227
    @sternparadis227 Před 4 měsíci

    Thanks for this great video. I have just one remark.
    When setting up a connection, do not call _defer db.Close()_ , before you check the error of _sql.Open_ . If there is an error, _nil_ is returned and calling _Close_ leads to a panic.

    • @bugbytes3923
      @bugbytes3923  Před 4 měsíci +1

      Ah - thank you for pointing that out!

  • @ConciseCabbage
    @ConciseCabbage Před 11 měsíci +2

    Please make a video showing how to use this sql database with an htmx app in golang too :)
    Also, I love that you don't have to deal with an ORM. The simple SQL query string is so refreshing!

    • @bugbytes3923
      @bugbytes3923  Před 11 měsíci

      Thanks - that's the plan, it should be released next month! Thanks for the feedback and for watching :)

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

      ​@@bugbytes3923 Thanks for the video!

  • @34556ndmd
    @34556ndmd Před 6 měsíci +1

    hi!! Thank you very much... you have such a great content which helped me!!!

    • @bugbytes3923
      @bugbytes3923  Před 6 měsíci

      Awesome to hear, thank you for commenting!

  • @lyhoangdong0909020227
    @lyhoangdong0909020227 Před 22 dny +1

    Thank you very much!

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

    This is such a great tutorial, thank you!

  • @iCrimzon
    @iCrimzon Před 11 měsíci

    Love your Go content, i went the mysql workbench route but still saw this vid regardless and understood from you what i didnt from my other YT mentor, def need more Go+DB/HTMX+Go tutorials/vids

    • @bugbytes3923
      @bugbytes3923  Před 11 měsíci

      Thanks a lot - I've got more planned soon! Thanks for watching!

  • @roger_that_do_you_copy
    @roger_that_do_you_copy Před 3 měsíci

    pretty cool! I'm getting into the Go trend it the language is cool and all. I'm eagle to learn it! but why is it most viral now than ever? Its been out.

  • @lifeofdandotme
    @lifeofdandotme Před rokem

    Excellent video. Everything simply explained. Thank you for these quality videos. :)

  • @AmoahDevLabs
    @AmoahDevLabs Před rokem +1

    Always great content. Thanks for the gist.

    • @bugbytes3923
      @bugbytes3923  Před rokem

      You are welcome, thanks as always for watching!

  • @AhmedSamy-fg5zz
    @AhmedSamy-fg5zz Před 6 měsíci

    Great content, Thank you very much.
    Can you please make a video about using database/sql with relationships and transactions.

  • @hans7714
    @hans7714 Před 10 měsíci

    Love this content.... Thanks for sharing.

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

    For anyone getting this Error: "pq: SSL is not enabled on the server"
    It seems that now sql.Open("postgres", connStr) does NOT support URL-based credentials.
    It wants a DSN (Data Source Name) format. Here is an example:
    connStr := fmt.Sprintf("host=%s port=%s user=%s password=%s dbname=%s sslmode=disable", host, port, username, password, database)
    db, err := sql.Open("postgres", connStr).

  • @mlsandreas
    @mlsandreas Před rokem +1

    Thank you for your great content!!

    • @bugbytes3923
      @bugbytes3923  Před rokem +1

      Thanks a lot for commenting and glad you like the content!

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

    Please more go content

  • @decay9984
    @decay9984 Před 11 měsíci

    Thank! Very informative video

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

    well, i have this error "pq: password authentication failed for user "postgres""

  • @mohamedwahman4099
    @mohamedwahman4099 Před rokem +2

    can you please make a full example crud application with golang ,maybe with Fiber or any other framework

  • @asawanted
    @asawanted Před 6 měsíci

    Is it important not to initialize the db variable as global. Cz I tried to declare db as global so that I don't need to pass. But if I do that I get runtime error like below:
    runtime error: invalid memory address or nil pointer dereference
    Any reason for this?

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

    how do you handle nullable values in golang sql?

  • @AchwaqKhalid
    @AchwaqKhalid Před 11 měsíci +1

    Why are Golang videos not in a playlist 🤔💬❓

    • @bugbytes3923
      @bugbytes3923  Před 11 měsíci +2

      Thanks for pointing that out, I owe you (somehow forgot to do so) - I have created one now!
      czcams.com/play/PL-2EBeDYMIbR1ag15E2MonJOj_cCIjUnd.html

    • @AchwaqKhalid
      @AchwaqKhalid Před 11 měsíci

      Bookmarked so cheers 🥂

  • @0lange
    @0lange Před 8 měsíci

    cold you please make a video as to how you would deploy a golang app that is connected to a database? thanks!

    • @bugbytes3923
      @bugbytes3923  Před 8 měsíci

      Great suggestion - thanks! Will look into more Go stuff very soon, including deployment.

  • @StrategyInRush
    @StrategyInRush Před rokem

    Can i request a big tutorial on HTML/templates like and example for building a simple website with it

    • @bugbytes3923
      @bugbytes3923  Před rokem +1

      Yeah, definitely gonna expand on templates with Go soon.

    • @StrategyInRush
      @StrategyInRush Před rokem

      @@bugbytes3923 template caching system would be an awesome tutorial ;)

  • @faizulla5838
    @faizulla5838 Před 11 měsíci

    How work without Docker? Sir.

  • @SonidoScoobyDoo
    @SonidoScoobyDoo Před 9 měsíci

    ok
    many people says that using gorm could give you performance problems in future.
    others says that using this sql package is really insecure.
    how can we prevent sql injection with database/sql ?