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

  Рет қаралды 127,843

Coding with Robby

Coding with Robby

Күн бұрын

Пікірлер: 151
@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 !
@inspirehub-rich
@inspirehub-rich Жыл бұрын
you are 100% correct
@MrCleverOnion
@MrCleverOnion 3 ай бұрын
But there is no GitHub repo available to look at like all the other ones
@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 10 ай бұрын
but the vid is "30-40"mins
@gamevlograce2937
@gamevlograce2937 7 ай бұрын
@@bekiteshome4670 hahahaha.. very stupid
@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.👏👏👏
@Laflamablanca969
@Laflamablanca969 2 жыл бұрын
Bro… great tutorial. Clear, concise and no BS 🎉 I’ve just subbed 👏
@codingwithrobby
@codingwithrobby 2 жыл бұрын
Thanks for the kind words!
@laxmangiri5511
@laxmangiri5511 Жыл бұрын
@@codingwithrobby I also subbed
@filiperodrigues6969
@filiperodrigues6969 5 ай бұрын
I would like to like this video way way way more times than just one, this is amazing, great job, the quality is off the charts
@ivancazzamali4508
@ivancazzamali4508 2 жыл бұрын
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
@darumaleo
@darumaleo 9 ай бұрын
damn man, i love this kind of videos! very concise, no wasting time, going straight to the point! very helpful
@geoffreyhoffman2739
@geoffreyhoffman2739 3 ай бұрын
As other commenters have said - I thought this was great. I feel like Gorm shouldn’t fetch a deleted model and the route should return 401 in that case. Just my $0.02. But that is more about Gorm. Nice work Robby! Another subscriber.
@christopherrobin5796
@christopherrobin5796 10 ай бұрын
beautiful tutorial, decent explanation, 10/10
@yoskokleng3658
@yoskokleng3658 9 ай бұрын
i am from laravel dev. this structure is similar to laravel. Great Video. i will follow this. Thank you
@therealchiko
@therealchiko 2 жыл бұрын
Awesome tutorial, concise and straight to the point!
@AbhinavNair-x8t
@AbhinavNair-x8t 3 ай бұрын
Super awesome. No bs video. Highly recommended
@eoinholland5647
@eoinholland5647 2 жыл бұрын
The most concise and clear tutorial on this topic! Thank You, I'm subbed now :D
@htetlinlinnaing4994
@htetlinlinnaing4994 2 жыл бұрын
This is the amazing video I have ever seen! Thank you and hope to upload more video about Golang.
@JDUDEadventure
@JDUDEadventure 8 ай бұрын
Thank you so much for posting this video. It really helped in teaching GO.
@nnguyetnam
@nnguyetnam 2 жыл бұрын
Great thanks!!!! You have opened my mind on how golang server can be built up in such a few concise steps.
@japanboy31415
@japanboy31415 Жыл бұрын
@14:39 why do we need to do func init(){} when we are importing initializers and models at the top with import()
@embrace7972
@embrace7972 Жыл бұрын
Amazing stuff man, really appreciate the content. I am new to golang, and the way you used the docs, I have learnt a lot.
@Surya001x
@Surya001x 8 ай бұрын
Best video, I was looking for this perfect videos. Thanks alot
@alfbaez
@alfbaez Жыл бұрын
Brilliant! simply put Brilliant! Thanks for knowledge sharing!
@morkhoudia9
@morkhoudia9 2 жыл бұрын
With these tutorials on go, i have skills on. Thanks you Robby.
@belski256
@belski256 2 жыл бұрын
Where are You..I am in the +256
@morkhoudia9
@morkhoudia9 Жыл бұрын
I am from Senegal, Africa
@ShrikrushnaCGundre
@ShrikrushnaCGundre Ай бұрын
great one, had a crazy ride
@JoseBarahonajrab66
@JoseBarahonajrab66 Жыл бұрын
Just starting on go , this tutorial was amazing 🤙🏻
@sondernfy
@sondernfy Жыл бұрын
Awesome! I'm just starting out, and this is pointing me the right way
@carshoesch
@carshoesch Ай бұрын
Nice video! Helped me learning the basics of gorm. But I would've returned with a internal error if the id is not within the db.
@thefulltutorial4278
@thefulltutorial4278 Жыл бұрын
Why you used package main here instead of package migrate 14:02
@XORknight
@XORknight Жыл бұрын
Best Golang API tutorial
@raunakagarwal6077
@raunakagarwal6077 2 ай бұрын
Very good explanation for beginners like me
@madeOfClay99
@madeOfClay99 3 ай бұрын
Thank you for the video. Although it would've been great to see if you handle dependency injection and the usage of a proper service layer to handle the DB logic. Additionally, I am not sure if moving the db creation and some other stuff into an env variable is a good practice. I understand this was a beginner tutorial, so thanks again.
@yishstudio8393
@yishstudio8393 Жыл бұрын
it's really helpful for me to understanding CURD with go and packages.
@simonjanca
@simonjanca Жыл бұрын
That's a great video I was looking around. Thanks :)
@ahmadfadhlirachmat5673
@ahmadfadhlirachmat5673 11 ай бұрын
Very compact tutorial, straight to the solution. Subs +1
@libertad83y
@libertad83y 2 жыл бұрын
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
@iqro199
@iqro199 8 ай бұрын
you are the best teacher bro)
@dowletodeberdiyew7412
@dowletodeberdiyew7412 4 ай бұрын
it seems like this guy is learning with us
@shubhamrane9389
@shubhamrane9389 6 ай бұрын
I am having issue after running migrate file. initializers.DB is coming out as nil. But in ConnectToDB I can establish connection DB. Is there some other platform to address issues like this?
@xjdn-34-gdndnk-45-aa
@xjdn-34-gdndnk-45-aa 5 ай бұрын
the same for me on 1.22. There is an issue with having DB globally. So golang complains about having DB variable assigned to value but used inside connection func. Now Im trying to return DB var from this functions so I could catch it and define any time I need DB from initializers. Looks like shit, if to be honest
@xjdn-34-gdndnk-45-aa
@xjdn-34-gdndnk-45-aa 5 ай бұрын
uh, I have fixed my problem. It seems like it is `DB, err :=` instead of `DB, err =`. So in my case it was a problem of a dynamic type defintion
@JhonatanMorais
@JhonatanMorais Жыл бұрын
Fantastic! you did great! thank you so much for share it!
@acronproject
@acronproject 11 ай бұрын
Thanks so much Mr.Robby. That very useful for me
@omartahboub2900
@omartahboub2900 Жыл бұрын
Great Tutorial ! String to the point !
@bronxed3666
@bronxed3666 2 жыл бұрын
Fantastic Video. thank you, subbed
@johnxisde
@johnxisde 2 жыл бұрын
Thanks for this tutorial, Robby! any idea about how effective delete data from db instead update that flag, deleted at?
@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 ?
@nicholasmaundu2130
@nicholasmaundu2130 Жыл бұрын
new subscriber, awesome content and document reference on point.
@alfathmuqoddas6986
@alfathmuqoddas6986 Жыл бұрын
Thank you very much! very concise and easy to follow
@guccigreatness4925
@guccigreatness4925 10 ай бұрын
Awesome tutorial & thank you bro 😊
@Ennem0_o
@Ennem0_o 10 ай бұрын
Thanks for the video. How would you add automatic Swagger/OpenAPI doc generation on this project ?
@7509whynotresist
@7509whynotresist Ай бұрын
beautifully explained with no bs
@caleyCodeLab
@caleyCodeLab 8 ай бұрын
Do you need to install CompileDaemon globally to use it? I'd like to manage it in a similar way to npm scripts
@mounis
@mounis 2 жыл бұрын
Amazing video, thanks for sharing!
@3damina911
@3damina911 2 жыл бұрын
Thanks! really easy and simple methods to CRUD in Go..
@youtobe00009
@youtobe00009 2 жыл бұрын
Nice and straight tutorial. thank you
@Yagnik_Sojitra
@Yagnik_Sojitra 13 күн бұрын
Great video, how to do error handling ?
@feynmaz
@feynmaz 2 жыл бұрын
Thank You for such a great tutorial
@NikhilKumar-sv2kb
@NikhilKumar-sv2kb 7 ай бұрын
Thank you very much!!! very helpful
@HenkeB515
@HenkeB515 10 ай бұрын
Great tutorial, thank you!
@zahreddinesoualem3213
@zahreddinesoualem3213 2 жыл бұрын
Very clear, neat tuto, thanks.
@cub379
@cub379 2 жыл бұрын
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 2 жыл бұрын
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 2 жыл бұрын
same issue with CompileDaemon, I just copied it in my project folder
@cub379
@cub379 2 жыл бұрын
@@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
@TdrMotoo
@TdrMotoo 2 жыл бұрын
Did you update your $PATH?
@cub379
@cub379 2 жыл бұрын
@@TdrMotoo yea, I have /home/leon/go/bin in my path
@wisdomelue
@wisdomelue Жыл бұрын
any reason why we had to do go get and go install for compile daemon
@narcissisticnarcissus4956
@narcissisticnarcissus4956 8 ай бұрын
Amazing!
@yaodenis2682
@yaodenis2682 Жыл бұрын
Great Tutorial !!!👏
@luthfiarsyad358
@luthfiarsyad358 2 жыл бұрын
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 2 жыл бұрын
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 2 жыл бұрын
@@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 ... }
@AyushSisodia-m3i
@AyushSisodia-m3i 9 ай бұрын
getting the error "command not found: CompileDaemon" even after installing the CompileDaemon using go get command in the project folder.
@codingwithrobby
@codingwithrobby 9 ай бұрын
You have to add your go bin folder to path then run go install not go get on the package
@asntechies8017
@asntechies8017 5 ай бұрын
Bro why did you stopped making golang videos. Can you make one for bulk insert/crud api with gin/postgres with jwt auth. Thanks in advance and keep up the good work 👍
@SaurabhSharmaIndia
@SaurabhSharmaIndia 2 жыл бұрын
Nice tutorial!! Can we return the response in camel case including created at and updated at?
@codingwithrobby
@codingwithrobby 2 жыл бұрын
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"`
@matinrazaghi3218
@matinrazaghi3218 2 жыл бұрын
Thank you for the great toturial
@elegantapps3055
@elegantapps3055 2 ай бұрын
thank you sir i learn a lot
@jewlouds
@jewlouds 11 ай бұрын
Is that Wubuntu?
@36-tycm-i-riteshmahale54
@36-tycm-i-riteshmahale54 7 ай бұрын
He is using git bash
@peterdaayeng7155
@peterdaayeng7155 Жыл бұрын
Great , Just suscribed
@tharaka911
@tharaka911 11 ай бұрын
thanks Robby you are awesome
@nadeemshareef7508
@nadeemshareef7508 9 ай бұрын
Awesome Brother!
@snoopy8870
@snoopy8870 Жыл бұрын
whats the music at the beginning?
@morkhoudia9
@morkhoudia9 2 жыл бұрын
Good & marvellous. Is it githubable ?
@vitojulianochannel
@vitojulianochannel 2 жыл бұрын
Thanks for the tutorial 👑 If you make the unit test for this, it will be more perfect 😁
@lemmyz1
@lemmyz1 2 жыл бұрын
Any suggestions to replicate this using mongo db?
@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
@shaheer1948
@shaheer1948 Жыл бұрын
Hello, Did you post the code anywhere!! Please !! I need the Code which you've Executed.
@MaheshKumar-bg5re
@MaheshKumar-bg5re 2 жыл бұрын
why cant we use the env variables in costants?
@muhmmadabubakarijaz1811
@muhmmadabubakarijaz1811 2 ай бұрын
a very informative video
@FoXSnoW1
@FoXSnoW1 2 жыл бұрын
where is repo.
@ianvieira283
@ianvieira283 Жыл бұрын
That was great!
@red_boum
@red_boum Жыл бұрын
Is there a Github for the final code?
@jokerboozp
@jokerboozp Жыл бұрын
Just awesome!!!!!!!Thank u!!!
@galangsatria7210
@galangsatria7210 Жыл бұрын
Nice Tutorials
@alessandroscimone5463
@alessandroscimone5463 2 жыл бұрын
Good video! Thanks
@faizulla5838
@faizulla5838 Жыл бұрын
How do it without Gorm ?
@ajith_e
@ajith_e Жыл бұрын
Thank you! btw. you sound like Rami Malek
@dharamraj6646
@dharamraj6646 2 жыл бұрын
@coding with roby where can i get this code ..?
@wisdomelue
@wisdomelue Жыл бұрын
loved it, thanks
@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
@mrginn
@mrginn 10 ай бұрын
thanks for the tutorial.
@sumitmehra258
@sumitmehra258 3 ай бұрын
As Elephantsql announces End of Life. Any alternative to that. Or can you update the video? Thanks @Coding with Robby
@falxcodeinc2072
@falxcodeinc2072 2 жыл бұрын
Good stuff !!!
@moeenkamali1288
@moeenkamali1288 2 жыл бұрын
it would be great if share source on github or somewhere else
@shehapeldien7025
@shehapeldien7025 Жыл бұрын
every thing works in first try
@MrAmG17
@MrAmG17 2 жыл бұрын
What about error handling?
@chotu-tv-12
@chotu-tv-12 Жыл бұрын
Thanks this helped me alot
@moeenkamali1288
@moeenkamali1288 2 жыл бұрын
nice work
@tgraupne
@tgraupne 2 жыл бұрын
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 2 жыл бұрын
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.
@MaheshKumar-bg5re
@MaheshKumar-bg5re 2 жыл бұрын
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 2 жыл бұрын
can i do without daemon compiler?
@codingwithrobby
@codingwithrobby 2 жыл бұрын
Yes, you’ll just have to manually restart when you make changes.
JWT Authentication in Go (Gin/Gorm)
35:26
Coding with Robby
Рет қаралды 78 М.
Пишем REST API сервис на Go - УЛЬТИМАТИВНЫЙ гайд
2:57:51
Николай Тузов — Golang
Рет қаралды 150 М.
She made herself an ear of corn from his marmalade candies🌽🌽🌽
00:38
Valja & Maxim Family
Рет қаралды 18 МЛН
Леон киллер и Оля Полякова 😹
00:42
Канал Смеха
Рет қаралды 4,7 МЛН
It’s all not real
00:15
V.A. show / Магика
Рет қаралды 20 МЛН
СИНИЙ ИНЕЙ УЖЕ ВЫШЕЛ!❄️
01:01
DO$HIK
Рет қаралды 3,3 МЛН
What Is THE BEST Web Framework In Golang? Why?
14:39
Anthony GG
Рет қаралды 50 М.
Building REST APIs in Go 1.22 - New Features
7:10
TutorialEdge
Рет қаралды 41 М.
This Is The BEST Way To Structure Your GO Projects
11:08
Melkey
Рет қаралды 85 М.
The TRUTH About Golang Backend Frameworks
6:31
Melkey
Рет қаралды 136 М.
Good APIs Vs Bad APIs: 7 Tips for API Design
5:48
ByteByteGo
Рет қаралды 253 М.
The standard library now has all you need for advanced routing in Go.
13:52
FULL Introduction To HTMX Using Golang
2:02:31
ThePrimeagen
Рет қаралды 406 М.
She made herself an ear of corn from his marmalade candies🌽🌽🌽
00:38
Valja & Maxim Family
Рет қаралды 18 МЛН