I go back and forth on ORMs. I think a lot depends on the complexity of the project. 

Still, I wouldn’t expect the overhead of an ORM to be more than 1-2% for IO/db bound systems - if it is I suspect it is not properly configured and it is generating inefficient queries or the database tables lack proper indexing. 

On Dec 19, 2024, at 9:17 AM, Mike Schinkel <m...@newclarity.net> wrote:

Hi Bhavesh,

I am also not a fan of ORMs, but I am a big fan of sqlc so I will 2nd Brian Candler's recommendation. 

Sqlc is one of the few Go packages/tools I consider a must-use for any of my projects that need to interact with SQL databases.

-Mike

On Dec 19, 2024, at 8:23 AM, 'Brian Candler' via golang-nuts <golang-nuts@googlegroups.com> wrote:

I am not a fan of ORMs. Application performance problems are usually down to poorly formed SQL queries (and/or lack of supporting indexes), which ORMs can mask or amplify.

For an alternative approach, have a look at https://github.com/sqlc-dev/sqlc

In short, you write the set of SQL queries to meet your application's needs, and then they get automatically wrapped in idiomatic Go.


Refs:

On Thursday, 19 December 2024 at 13:01:25 UTC Bhavesh Kothari wrote:

I read few posts regarding ORMs in golang & realized, few peoples are not happy with it.

They mentioned to use raw queries with our own wrapper if want to make few things reusable.

I was actually using Gorm, which was super slow, then I started research regarding performance efficient ORMs, and found Bun which was indeed faster compared to Gorm. But then I explored documentation more and realized it doesn't provide enough function to make life easier, this ORM even doesn't have community I felt.

1. I want to know readers view regarding ORMs in Go.

Let me tell you something, my project is a huge project, and I decided to use Golang for better performance. But now I feel I've to write a lot of code and slow/less-featured ORMs here making me irritated.

2. What do you guys suggest is go really good for large projects?


-- 
You received this message because you are subscribed to the Google Groups "golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscr...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/golang-nuts/6addef83-3e2d-4b6c-b543-8127f5754f0en%40googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscr...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/golang-nuts/C487B8AE-D8EF-47AE-A06C-48AC422DFD07%40newclarity.net.

--
You received this message because you are subscribed to the Google Groups "golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscr...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/golang-nuts/F74D79AA-C723-4204-8F20-1F488CAB297F%40ix.netcom.com.

Reply via email to