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 !
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.👏👏👏
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
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.
Jeez! You deserve 100x more subscribers, great teaching! 🥳 One question: "what is the advantage of tableplus compared to the integrated browser of ElephantSQL?"
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?
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
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.
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 ?
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 👍
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!
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.
@@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 🤣🤣
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 ... }
DB should be used within the ConnectToDatabase function. Double check your code matches mine. You probably have := instead of just = . Hope this helps!
@@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
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
@@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
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 !
you are 100% correct
But there is no GitHub repo available to look at like all the other ones
Awesome!! No bullshit, straight to the point. You teach in 10 mins what others teach in 30-40 mins. Great job!
but the vid is "30-40"mins
@@bekiteshome4670 hahahaha.. very stupid
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.👏👏👏
Bro… great tutorial. Clear, concise and no BS 🎉 I’ve just subbed 👏
Thanks for the kind words!
@@codingwithrobby I also subbed
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
damn man, i love this kind of videos! very concise, no wasting time, going straight to the point! very helpful
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
Awesome tutorial, concise and straight to the point!
The most concise and clear tutorial on this topic! Thank You, I'm subbed now :D
beautiful tutorial, decent explanation, 10/10
This is the amazing video I have ever seen! Thank you and hope to upload more video about Golang.
Super awesome. No bs video. Highly recommended
i am from laravel dev. this structure is similar to laravel. Great Video. i will follow this. Thank you
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.
Great thanks!!!! You have opened my mind on how golang server can be built up in such a few concise steps.
great one, had a crazy ride
Thank you so much for posting this video. It really helped in teaching GO.
Best Golang API tutorial
Amazing stuff man, really appreciate the content. I am new to golang, and the way you used the docs, I have learnt a lot.
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.
Brilliant! simply put Brilliant! Thanks for knowledge sharing!
Just starting on go , this tutorial was amazing 🤙🏻
Very good explanation for beginners like me
With these tutorials on go, i have skills on. Thanks you Robby.
Where are You..I am in the +256
I am from Senegal, Africa
Awesome! I'm just starting out, and this is pointing me the right way
Best video, I was looking for this perfect videos. Thanks alot
it seems like this guy is learning with us
Great video, how to do error handling ?
Jeez! You deserve 100x more subscribers, great teaching! 🥳 One question: "what is the advantage of tableplus compared to the integrated browser of ElephantSQL?"
and then he opens postman not three minutes later lol
Thanks for this tutorial, Robby! any idea about how effective delete data from db instead update that flag, deleted at?
you are the best teacher bro)
@14:39 why do we need to do func init(){} when we are importing initializers and models at the top with import()
Great Tutorial ! String to the point !
Thanks for the video.
How would you add automatic Swagger/OpenAPI doc generation on this project ?
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?
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
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
That's a great video I was looking around. Thanks :)
Thanks so much Mr.Robby. That very useful for me
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.
Very compact tutorial, straight to the solution. Subs +1
beautifully explained with no bs
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 ?
Fantastic! you did great! thank you so much for share it!
Thank you very much! very concise and easy to follow
it's really helpful for me to understanding CURD with go and packages.
Fantastic Video. thank you, subbed
Awesome tutorial & thank you bro 😊
new subscriber, awesome content and document reference on point.
Is that Wubuntu?
He is using git bash
a very informative video
Great tutorial, thank you!
Amazing video, thanks for sharing!
Nice tutorial!!
Can we return the response in camel case including created at and updated at?
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"`
thanks Robby you are awesome
Why you used package main here instead of package migrate 14:02
Nice and straight tutorial. thank you
thank you sir i learn a lot
Very clear, neat tuto, thanks.
Thank you for the great toturial
Thank You for such a great tutorial
Do you need to install CompileDaemon globally to use it? I'd like to manage it in a similar way to npm scripts
Amazing!
Thanks! really easy and simple methods to CRUD in Go..
Great Tutorial !!!👏
Thank you very much!!! very helpful
Nice Tutorials
Good video! Thanks
Good & marvellous. Is it githubable ?
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 👍
nice work
any reason why we had to do go get and go install for compile daemon
Great , Just suscribed
Awesome Brother!
thanks for the tutorial.
loved it, thanks
where is repo.
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!
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.
@@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 🤣🤣
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
...
}
whats the music at the beginning?
hmm, initializers/Postgres.go:16:2: DB declared but not used
DB should be used within the ConnectToDatabase function. Double check your code matches mine. You probably have := instead of just = . Hope this helps!
@@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
What's the request making tool you use to test the API?
Postman
@@codingwithrobby Thanks. Seems as must-to-have for backend
Thanks this helped me alot
Hello, Did you post the code anywhere!! Please !! I need the Code which you've Executed.
Any suggestions to replicate this using mongo db?
Is there a Github for the final code?
Thanks for the tutorial 👑 If you make the unit test for this, it will be more perfect 😁
Just awesome!!!!!!!Thank u!!!
How do it without Gorm ?
Good stuff !!!
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
I'm running 1.18.3. Here's an alternative I've used if you can't get it going: github.com/codegangsta/gin
same issue with CompileDaemon, I just copied it in my project folder
@@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
Did you update your $PATH?
@@TdrMotoo yea, I have /home/leon/go/bin in my path
why cant we use the env variables in costants?
getting the error "command not found: CompileDaemon" even after installing the CompileDaemon using go get command in the project folder.
You have to add your go bin folder to path then run go install not go get on the package
@coding with roby where can i get this code ..?
it would be great if share source on github or somewhere else
That was great!
every thing works in first try
can you share ur cheatsheet
What about error handling?
As Elephantsql announces End of Life. Any alternative to that. Or can you update the video? Thanks @Coding with Robby
Too good
Nice
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?
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.