Creating a JSON CRUD API in Go (Gin/GORM)

  Рет қаралды 106,218

Coding with Robby

Coding with Robby

Жыл бұрын

In this video we'll create a basic JSON CRUD API in Go lang using the popular framework Gin and the top ORM GORM. This is a great beginner tutorial if you're just starting out with Go and will introduce you to some popular libraries.
Make sure to like and subscribe!

Пікірлер: 129
@japanboy31415
@japanboy31415 Жыл бұрын
the reason that i like this tutorial the most is because he actually shows where the code is coming from within the documentation. these other ones, i feel like theyre just pulling it out of their asses and it is so confusing. thank you so much !
@richmondelaigwu2658
@richmondelaigwu2658 9 ай бұрын
you are 100% correct
@kannankalidasan
@kannankalidasan Жыл бұрын
Just 1 video watched . become a channel member, subscribed, pressed bell button 😃 , Got a real confidence in building my first go project by going through this.👏👏👏
@therealchiko
@therealchiko Жыл бұрын
Awesome tutorial, concise and straight to the point!
@md.mahadyhasan8456
@md.mahadyhasan8456 Жыл бұрын
Awesome!! No bullshit, straight to the point. You teach in 10 mins what others teach in 30-40 mins. Great job!
@bekiteshome4670
@bekiteshome4670 3 ай бұрын
but the vid is "30-40"mins
@gamevlograce2937
@gamevlograce2937 11 күн бұрын
@@bekiteshome4670 hahahaha.. very stupid
@eoinholland5647
@eoinholland5647 Жыл бұрын
The most concise and clear tutorial on this topic! Thank You, I'm subbed now :D
@nnguyetnam
@nnguyetnam Жыл бұрын
Great thanks!!!! You have opened my mind on how golang server can be built up in such a few concise steps.
@Laflamablanca969
@Laflamablanca969 Жыл бұрын
Bro… great tutorial. Clear, concise and no BS 🎉 I’ve just subbed 👏
@codingwithrobby
@codingwithrobby Жыл бұрын
Thanks for the kind words!
@laxmangiri5511
@laxmangiri5511 Жыл бұрын
@@codingwithrobby I also subbed
@LeonardoSerra92
@LeonardoSerra92 2 ай бұрын
damn man, i love this kind of videos! very concise, no wasting time, going straight to the point! very helpful
@htetlinlinnaing4994
@htetlinlinnaing4994 Жыл бұрын
This is the amazing video I have ever seen! Thank you and hope to upload more video about Golang.
@ivancazzamali4508
@ivancazzamali4508 Жыл бұрын
supernice! I really like that you keep the loop "say what you'll implement" --> "code" --> "check result" very short. it makes it very easy to follow and see what does what. immediately subscribed
@sondernfy
@sondernfy Жыл бұрын
Awesome! I'm just starting out, and this is pointing me the right way
@embrace7972
@embrace7972 7 ай бұрын
Amazing stuff man, really appreciate the content. I am new to golang, and the way you used the docs, I have learnt a lot.
@JoseBarahonajrab66
@JoseBarahonajrab66 6 ай бұрын
Just starting on go , this tutorial was amazing 🤙🏻
@JDUDEadventure
@JDUDEadventure Ай бұрын
Thank you so much for posting this video. It really helped in teaching GO.
@alfbaez
@alfbaez Жыл бұрын
Brilliant! simply put Brilliant! Thanks for knowledge sharing!
@christopherrobin5796
@christopherrobin5796 3 ай бұрын
beautiful tutorial, decent explanation, 10/10
@mounis
@mounis Жыл бұрын
Amazing video, thanks for sharing!
@JhonatanMorais
@JhonatanMorais Жыл бұрын
Fantastic! you did great! thank you so much for share it!
@alfathmuqoddas6986
@alfathmuqoddas6986 11 ай бұрын
Thank you very much! very concise and easy to follow
@Surya001x
@Surya001x Ай бұрын
Best video, I was looking for this perfect videos. Thanks alot
@zahreddinesoualem3213
@zahreddinesoualem3213 Жыл бұрын
Very clear, neat tuto, thanks.
@youtobe00009
@youtobe00009 Жыл бұрын
Nice and straight tutorial. thank you
@omartahboub2900
@omartahboub2900 9 ай бұрын
Great Tutorial ! String to the point !
@simonjanca
@simonjanca Жыл бұрын
That's a great video I was looking around. Thanks :)
@3damina911
@3damina911 Жыл бұрын
Thanks! really easy and simple methods to CRUD in Go..
@yishstudio8393
@yishstudio8393 Жыл бұрын
it's really helpful for me to understanding CURD with go and packages.
@acronproject
@acronproject 3 ай бұрын
Thanks so much Mr.Robby. That very useful for me
@yoskokleng3658
@yoskokleng3658 2 ай бұрын
i am from laravel dev. this structure is similar to laravel. Great Video. i will follow this. Thank you
@feynmaz
@feynmaz Жыл бұрын
Thank You for such a great tutorial
@japanboy31415
@japanboy31415 Жыл бұрын
out of all the crud videos on golang that i have watched, this is the best one. Is this an accurate representation of how to actually create a golang, or are we not getting introduced something ? i watched akhils tutorial and it was so complicated that i was so lost, but this one seems to do all of the CRUD endpoints and was wondering if I can use this as a reference ?
@guccigreatness4925
@guccigreatness4925 3 ай бұрын
Awesome tutorial & thank you bro 😊
@HenkeB515
@HenkeB515 3 ай бұрын
Great tutorial, thank you!
@XORknight
@XORknight 9 ай бұрын
Best Golang API tutorial
@matinrazaghi3218
@matinrazaghi3218 Жыл бұрын
Thank you for the great toturial
@morkhoudia9
@morkhoudia9 Жыл бұрын
With these tutorials on go, i have skills on. Thanks you Robby.
@belski256
@belski256 Жыл бұрын
Where are You..I am in the +256
@morkhoudia9
@morkhoudia9 10 ай бұрын
I am from Senegal, Africa
@bronxed3666
@bronxed3666 Жыл бұрын
Fantastic Video. thank you, subbed
@libertad83y
@libertad83y Жыл бұрын
Jeez! You deserve 100x more subscribers, great teaching! 🥳 One question: "what is the advantage of tableplus compared to the integrated browser of ElephantSQL?"
@brandonjapol9853
@brandonjapol9853 Жыл бұрын
and then he opens postman not three minutes later lol
@NikhilKumar-sv2kb
@NikhilKumar-sv2kb 13 күн бұрын
Thank you very much!!! very helpful
@ahmadfadhlirachmat5673
@ahmadfadhlirachmat5673 4 ай бұрын
Very compact tutorial, straight to the solution. Subs +1
@johnxisde
@johnxisde Жыл бұрын
Thanks for this tutorial, Robby! any idea about how effective delete data from db instead update that flag, deleted at?
@nicholasmaundu2130
@nicholasmaundu2130 11 ай бұрын
new subscriber, awesome content and document reference on point.
@iqro199
@iqro199 Ай бұрын
you are the best teacher bro)
@narcissisticnarcissus4956
@narcissisticnarcissus4956 Ай бұрын
Amazing!
@yaodenis2682
@yaodenis2682 Жыл бұрын
Great Tutorial !!!👏
@ianvieira283
@ianvieira283 Жыл бұрын
That was great!
@jokerboozp
@jokerboozp Жыл бұрын
Just awesome!!!!!!!Thank u!!!
@wisdomelue
@wisdomelue 7 ай бұрын
loved it, thanks
@alessandroscimone5463
@alessandroscimone5463 Жыл бұрын
Good video! Thanks
@vitojulianochannel
@vitojulianochannel Жыл бұрын
Thanks for the tutorial 👑 If you make the unit test for this, it will be more perfect 😁
@csnawwa
@csnawwa 4 ай бұрын
thanks Robby you are awesome
@nadeemshareef7508
@nadeemshareef7508 2 ай бұрын
Awesome Brother!
@Ennem0_o
@Ennem0_o 3 ай бұрын
Thanks for the video. How would you add automatic Swagger/OpenAPI doc generation on this project ?
@falxcodeinc2072
@falxcodeinc2072 Жыл бұрын
Good stuff !!!
@mrginn
@mrginn 3 ай бұрын
thanks for the tutorial.
@peterdaayeng7155
@peterdaayeng7155 6 ай бұрын
Great , Just suscribed
@abhishekrajput4656
@abhishekrajput4656 11 ай бұрын
Thanks this helped me alot
@galangsatria7210
@galangsatria7210 Жыл бұрын
Nice Tutorials
@moeenkamali1288
@moeenkamali1288 Жыл бұрын
nice work
@SaurabhSharmaIndia
@SaurabhSharmaIndia Жыл бұрын
Nice tutorial!! Can we return the response in camel case including created at and updated at?
@codingwithrobby
@codingwithrobby Жыл бұрын
Yes you can, try replacing the gorm.Model line with: ID uint `gorm:"primary_key" json:"id"` CreatedAt time.Time `json:"createdAt"` UpdatedAt time.Time `json:"updatedAt"` DeletedAt *time.Time `json:"deletedAt"`
@japanboy31415
@japanboy31415 Жыл бұрын
@14:39 why do we need to do func init(){} when we are importing initializers and models at the top with import()
@morkhoudia9
@morkhoudia9 Жыл бұрын
Good & marvellous. Is it githubable ?
@lemmyz1
@lemmyz1 Жыл бұрын
Any suggestions to replicate this using mongo db?
@caleyCodeLab
@caleyCodeLab Ай бұрын
Do you need to install CompileDaemon globally to use it? I'd like to manage it in a similar way to npm scripts
@InstallSkill
@InstallSkill 2 ай бұрын
Too good
@manee427
@manee427 Жыл бұрын
Perfect
@wisdomelue
@wisdomelue 6 ай бұрын
any reason why we had to do go get and go install for compile daemon
@MaheshKumar-bg5re
@MaheshKumar-bg5re Жыл бұрын
why cant we use the env variables in costants?
@SMELLNES
@SMELLNES Жыл бұрын
clean
@nerochaniago81
@nerochaniago81 11 ай бұрын
cool!
@cub379
@cub379 Жыл бұрын
What version of go are you running here? I can't get the CompileDaemon to work. edit: If anybody else encounters with the same issue, fix on my end was that i forgot to add the gon/bin/ folder to my PATH
@codingwithrobby
@codingwithrobby Жыл бұрын
I'm running 1.18.3. Here's an alternative I've used if you can't get it going: github.com/codegangsta/gin
@libertad83y
@libertad83y Жыл бұрын
same issue with CompileDaemon, I just copied it in my project folder
@cub379
@cub379 Жыл бұрын
@@libertad83y i am pretty sure you have to place compile deamon in golang install folder and then bin, i can check when i come home from work remind mi if i forget hah
@TudorCizmas
@TudorCizmas Жыл бұрын
Did you update your $PATH?
@cub379
@cub379 Жыл бұрын
@@TudorCizmas yea, I have /home/leon/go/bin in my path
@luthfiarsyad358
@luthfiarsyad358 Жыл бұрын
Hello Robby, it was a great tutorial step by step but i encounter an error when go run migrate/migrate.go saying invalid memory address or nil pointer dereference.. please help on telling me what to do :( thank you!
@codingwithrobby
@codingwithrobby Жыл бұрын
Hey there, sounds like the models didn't import correctly or you made a typo somewhere. I'd go through and double check everything matches mine in the video.
@luthfiarsyad358
@luthfiarsyad358 Жыл бұрын
@@codingwithrobby LOL IT IS, i was writing a typo, i shouldve not declarating var on migrate, i should use = instead of := 😁😁 my mistake man, thank youu for helping 🤣🤣
@emirhansoylu
@emirhansoylu Жыл бұрын
I've got same error too. Idk why it throw error but i solve it by adding the assignment. var DB *gorm.DB func ConnectToDB() { ... db, err := gorm.Open(postgres.Open(dsn), &gorm.Config{}) DB = db ... }
@shaheer1948
@shaheer1948 11 ай бұрын
Hello, Did you post the code anywhere!! Please !! I need the Code which you've Executed.
@DioArsya
@DioArsya Жыл бұрын
Nicee
@UnboxLabOfficial
@UnboxLabOfficial 9 ай бұрын
Nice
@dharamraj6646
@dharamraj6646 Жыл бұрын
@coding with roby where can i get this code ..?
@MrAmG17
@MrAmG17 Жыл бұрын
What about error handling?
@red_boum
@red_boum 9 ай бұрын
Is there a Github for the final code?
@shehapeldien7025
@shehapeldien7025 6 ай бұрын
every thing works in first try
@user-ro9ty1qk6r
@user-ro9ty1qk6r 2 ай бұрын
getting the error "command not found: CompileDaemon" even after installing the CompileDaemon using go get command in the project folder.
@codingwithrobby
@codingwithrobby 2 ай бұрын
You have to add your go bin folder to path then run go install not go get on the package
@moeenkamali1288
@moeenkamali1288 Жыл бұрын
it would be great if share source on github or somewhere else
@ajith_e
@ajith_e 7 ай бұрын
Thank you! btw. you sound like Rami Malek
@simonjanca
@simonjanca Жыл бұрын
What's the request making tool you use to test the API?
@codingwithrobby
@codingwithrobby Жыл бұрын
Postman
@simonjanca
@simonjanca Жыл бұрын
@@codingwithrobby Thanks. Seems as must-to-have for backend
@snoopy8870
@snoopy8870 5 ай бұрын
whats the music at the beginning?
@tgraupne
@tgraupne Жыл бұрын
Hi @Coding with Robby , great video, than you very much. Do you have a Github profile or any other way you could share your code?
@codingwithrobby
@codingwithrobby Жыл бұрын
Thanks for watching! To be honest I didn't save any of the code from this video. In future videos I'll try to provide GitHub links.
@FoXSnoW1
@FoXSnoW1 Жыл бұрын
where is repo.
@drefaux6669
@drefaux6669 Жыл бұрын
great tutorial but you should also catch errors in this vid too
@chrishabgood8900
@chrishabgood8900 Жыл бұрын
hmm, initializers/Postgres.go:16:2: DB declared but not used
@codingwithrobby
@codingwithrobby Жыл бұрын
DB should be used within the ConnectToDatabase function. Double check your code matches mine. You probably have := instead of just = . Hope this helps!
@muhammadfauzanalghifari7776
@muhammadfauzanalghifari7776 Жыл бұрын
@@codingwithrobby I have the same problem and this solved my problem, thank u!! i am new to golang did not notice this at the first place, btw this vid really helps! thank u once again
@MaheshKumar-bg5re
@MaheshKumar-bg5re Жыл бұрын
is postgresql better than mysql?
@codingwithrobby
@codingwithrobby Жыл бұрын
I think it’s mostly personal preference. I just started using Postgres because Heroku supports it.
@tnnz9920
@tnnz9920 Жыл бұрын
can i do without daemon compiler?
@codingwithrobby
@codingwithrobby Жыл бұрын
Yes, you’ll just have to manually restart when you make changes.
@faizulla5838
@faizulla5838 7 ай бұрын
How do it without Gorm ?
@thefulltutorial4278
@thefulltutorial4278 8 ай бұрын
Why you used package main here instead of package migrate 14:02
@jewlouds
@jewlouds 4 ай бұрын
Is that Wubuntu?
@36-tycm-i-riteshmahale54
@36-tycm-i-riteshmahale54 17 күн бұрын
He is using git bash
@MrCleverOnion
@MrCleverOnion 3 ай бұрын
My only complaint is that there's no links. It's so much easier to just read the code
@it1860
@it1860 Жыл бұрын
em where github / gitlab url of code ?
@nandhawalrost
@nandhawalrost 4 ай бұрын
thank you, good karma
@leodegrinchi6878
@leodegrinchi6878 9 ай бұрын
17:22 создали))) 😄
@ThePirateHistory
@ThePirateHistory 2 ай бұрын
That's kinda GoRuby, but not go...
@dhanushg5254
@dhanushg5254 19 күн бұрын
Excellent Video but your naming scheme sucks
@hagbard8774
@hagbard8774 Жыл бұрын
What should do if go build returns error like: .\main.go:8:2: undefined: initializers .\main.go:12:13: undefined: controllers tried to run: export GO111MODULE=on go init mod go-crud go tidy mod
@it1860
@it1860 Жыл бұрын
Can you provide GitHub link for this project?
JWT Authentication in Go (Gin/Gorm)
35:26
Coding with Robby
Рет қаралды 62 М.
Build a Rest API with GoLang
34:14
Laith Academy
Рет қаралды 110 М.
어른의 힘으로만 할 수 있는 버블티 마시는법
00:15
진영민yeongmin
Рет қаралды 10 МЛН
КАК СПРЯТАТЬ КОНФЕТЫ
00:59
123 GO! Shorts Russian
Рет қаралды 3 МЛН
I Built a Shelter House For myself and Сat🐱📦🏠
00:35
TooTool
Рет қаралды 9 МЛН
I Need Your Help..
00:33
Stokes Twins
Рет қаралды 145 МЛН
Build a REST API in Go using Fiber + GORM
1:28:30
rithmic
Рет қаралды 38 М.
The standard library now has all you need for advanced routing in Go.
13:52
Is Fiber the best Go web framework? Better than Gin?
21:07
Coding with Robby
Рет қаралды 36 М.
Go in 100 Seconds
2:30
Fireship
Рет қаралды 1,5 МЛН
Git MERGE vs REBASE
16:12
Academind
Рет қаралды 1 МЛН
Build A Go REST API, React.js & TypeScript Todo Application
38:17
Designing scalable Compose APIs
19:53
Android Developers
Рет қаралды 10 М.
Why Golang Developers HATE Gorm…
4:07
Golang Dojo
Рет қаралды 29 М.
3 Golang Tips For Beginners I Wish I Knew Sooner
13:18
Anthony GG
Рет қаралды 31 М.
Xiaomi Note 13 Pro по безумной цене в России
0:43
Простые Технологии
Рет қаралды 2 МЛН
Apple watch hidden camera
0:34
_vector_
Рет қаралды 52 МЛН
3.5.A Solar Mobile 📱 Charger
0:39
Gaming zone
Рет қаралды 320 М.