Why Golang Developers HATE Gorm…

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
what is a Guam why is it the most popular orml library for go what is an orm and if it's so popular why do so many go developers hate it and at the same time before we get started make sure to get your free golang cheat sheet at golang dojo.com cheat sheet that said our Golan ninja Tommy here has the answers to all of these questions about Guam thanks Wallace it's Tommy the goaling ninja here and let's get started gorm the Fantastic orm library for golang let's first talk about orm in Gorham g-o-r-m orm stands for object relational mapping it's a technique that lets you query and manipulate data from a database using an object-oriented Paradigm more simply put it helps you map SQL objects into objects of the programming language of your choice when talking about orm most people are referring to a library that implements object relational mapping technique hence the phrase oh just use an orm some of the benefits of an orm includes you don't have to write your own poorly formed SQL queries especially since SQL is often treated like a sub language when in reality it's a very powerful and complex language second it often provides additional security features like SQL injection protection also most orm works really well with Ides and provides great type check syntax highlighting and so on now let's talk about gorm gorm stands for golang object relational mapping it is the most popular orn library for go on top of the benefits any Oram typically comes with as mentioned earlier here are some notable additional features go context support you can make use of request sessions in your application for example built-in eager loading which is especially handy for certain types of performance requirements built-in middleware such as loggers also note that technically you can write raw SQL queries via gorm as well and the list goes on you can get started by importing the gorm package and the corresponding database driver and then enjoy the convenience it provides now if gorm is the most popular orm library for Goa and it has so many benefits why do many go developers still don't feel so hot about gorm or orm libraries in general first of all go developers tend to cater towards features as a language natively support because it offers more flexibility and extensibility unless absolutely necessary no to minimum libraries are greatly preferred one good example is complex joints can become hairy very quickly even if the orm may have some basic joint supports in more complex projects at some point you may have to start using raw database queries so why not use raw queries from the start for a cleaner architecture secondly go developers do care a great deal about the performance of their applications if you are using an orm then you'll have to pay a performance penalty because of the extra layer of abstraction which can become apparent as the complexity of the queries grows along with a project last but not least if issues do occur because of the orm you're using it can be a nightmare to debug and fix so what alternatives are there if not gorm first of all we can write our own SQL queries secondly we can utilize SQL compilers like sqlc if you'd like like to learn more about SQL compilers working alongside with go and want me to make a full tutorial on it let me know in the comments below generally speaking gorm does its job perfectly fine if you're building basic crud operations anything more complicated than that it'll typically be better off exploring more sophisticated Alternatives before you go make sure to get your free goal line cheat sheet at golangdojo.com cheat sheet like subscribe and turn on your notification Bell and now we'll see you ninjas in the very next video [Music] foreign [Music]
Info
Channel: Golang Dojo
Views: 30,591
Rating: undefined out of 5
Keywords: golang, learn golang, go lang, go language, golang tutorial, go programming, golang for beginners, golang 2022, golang gorm, go gorm, gorm golang, orm golang, golang orm, golang library, golang sql, golang sqlc, sqlc golang, sql golang, should I use gorm, golang framework, golang libraries, golang open source, go languange, gorm, what is gorm, why golang developers hate gorm, orm, most popular orm, object relational mapping, orm benefits, orm library, features, sqlc
Id: iRVROuZpzFk
Channel Id: undefined
Length: 4min 7sec (247 seconds)
Published: Fri Sep 30 2022
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.