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

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

КОМЕНТАРІ • 62

  • @seydinaoumarsamabaly1806
    @seydinaoumarsamabaly1806 Рік тому +8

    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  Рік тому +2

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

  • @egenethebest9107
    @egenethebest9107 8 місяців тому +3

    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!!! 😍😍😍

  • @PyroVox
    @PyroVox 7 місяців тому +3

    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.

  • @abessesmahi4888
    @abessesmahi4888 Рік тому +5

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

    • @bugbytes3923
      @bugbytes3923  Рік тому +3

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

  • @baz_sh
    @baz_sh 11 місяців тому +1

    This is such a great tutorial, thank you!

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

    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  Рік тому

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

  • @34556ndmd
    @34556ndmd 9 місяців тому +1

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

    • @bugbytes3923
      @bugbytes3923  9 місяців тому

      Awesome to hear, thank you for commenting!

  • @ConciseCabbage
    @ConciseCabbage Рік тому +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  Рік тому

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

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

      ​@@bugbytes3923 Thanks for the video!

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

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

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

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

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

    Always great content. Thanks for the gist.

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

      You are welcome, thanks as always for watching!

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

    Thank you for your great content!!

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

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

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

    Love this content.... Thanks for sharing.

  • @alperaslan.
    @alperaslan. 3 місяці тому +1

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

    • @bugbytes3923
      @bugbytes3923  3 місяці тому +1

      In the near future perhaps ;) Thanks!

  • @bdud_
    @bdud_ Місяць тому +1

    spasibo!very accessible

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

    Thank you very much!

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

      No worries thanks for commenting!

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

    Thank! Very informative video

  • @AhmedSamy-fg5zz
    @AhmedSamy-fg5zz 9 місяців тому

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

    • @bugbytes3923
      @bugbytes3923  9 місяців тому

      Thanks a lot! Great idea, will do!

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

    Please more go content

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

    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  7 місяців тому +1

      Ah - thank you for pointing that out!

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

    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.

  • @asawanted
    @asawanted 9 місяців тому

    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?

  • @mohamedwahman4099
    @mohamedwahman4099 Рік тому +2

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

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

    how do you handle nullable values in golang sql?

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

    Why are Golang videos not in a playlist 🤔💬❓

    • @bugbytes3923
      @bugbytes3923  Рік тому +2

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

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

      Bookmarked so cheers 🥂

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

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

    • @MikeSmith-wr4yc
      @MikeSmith-wr4yc 25 днів тому

      Must've mistyped the password, try asking chat gpt to help with it

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

    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).

  • @MakeAsPro
    @MakeAsPro Місяць тому

    every Python developer make video about Golang programing 😂😂😂

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

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

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

      Yeah, definitely gonna expand on templates with Go soon.

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

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

  • @0lange
    @0lange Рік тому

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

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

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

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

    How work without Docker? Sir.

  • @sergeibatiuk3468
    @sergeibatiuk3468 Місяць тому

    What kind of accent is this?

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

    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 ?

    • @maximofernandez196
      @maximofernandez196 9 місяців тому

      the syntax at 16:40 is supposed to take care of that