3 ms·
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
by nkozyra 8y ago
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.
- sheeshkebab 8y agoI 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.
- darkr 8y agoThe 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.