Hacker News new | past | comments | ask | show | jobs | submit login

In go, Querying SQL is very much like doing the same thing with the base libraries for mysql in C. Doing the same in most any other language is much much easier and just as safe.

Credentials: Worked mainly in go for 4 years... 18+ years coding in about 9 languages.

Yes I realized this is opinion.




Huh? How is database handling different in Go? You write a parametrized query, the driver prepares it and you deal with the response.

MySQLd in PHP is a mirror process, and in fact retains the C function names.


I think the parent refers to lack of automated result to struct mappers, or maybe lack of decent orm... although it’s probably lacking not due to go features, it’s just that kind of magic is typically not the go way.


The lack of automated result > data model mappers is kind of by design with statically typed languages. IMO, Go's structs approach is much more lightweight than languages like Scala where large amounts of time can be spent defining exquisite types. Though - one option is to just accept a slice of `[]interface{}` (or an `Any` in Scala), but then you're negating the type-safety provided by statically typed languages.

WRT ORMs - Go has ORMs, some of them look reasonable. I'm not a big fan of ORMs in general though. IMHO the only valid use cases for ORM's are for applications that need to support multiple database technologies, or where the application developers don't know SQL.




Join us for AI Startup School this June 16-17 in San Francisco!

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: