Hey, I keep hearing ORMs - especially GORM - is slow. But I have never felted like it was slow and used in a couple of projects now. Is there a good article you recommend reading about ORMs in Go - especially GORM - being slow?
Sorry, my reply is not actually an answer to the original question. But I am really curious about it now. Is it really important, really slow? Thanks, Kerem 20 Aralık 2024 Cuma tarihinde saat 03:59:09 UTC+3 itibarıyla Jason E. Aten şunları yazdı: > If you want to avoid boilerplate and keep the lightest weight possible, > you could have a look at the approach I took recently when I > added SQL support in my serialization format, greenpack. > > See here: (only supports MariaDB/MySQL syntax at the moment) > > > https://github.com/glycerine/greenpack?tab=readme-ov-file#december-2024-sql-support > > https://github.com/glycerine/greenpack/blob/master/testdata/_sqldemo_gen.go > > The code-generation will generate the > SQL create, insert, and select statements corresponding to each struct > in the files that have //go:generate greenpack -sql mariadb > in them. > > This is minimal and ultra simple but still saves manually writing tedious > boilerplate. > It keeps your fields received always aligned with your select statements. > It is appropriate if your Go code is your source-of-truth/starting point. > > The other packages I looked at (ORMs, etc) seem to want > to take the database schema as the starting point, and create Go code from > that. > > That's a reasonable approach, but not what I needed. > > Enjoy, > Jason > > -- 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/ecd8789f-2f4b-45d7-ac14-1f28d9fd3a38n%40googlegroups.com.