3 ms·
This is the sweet spot of ORMs. A team lead early in my career wrote a tool that read the database schema and generated all the marshaling code at the applicati
by dhd415 10y ago
This is the sweet spot of ORMs. A team lead early in my career wrote a tool that read the database schema and generated all the marshaling code at the application layer. We got a degree of type safety and relief from a lot of boilerplate code but no promises of automatically generating SQL or abstracting away the database schema, etc. It worked so well that I wrote one from scratch in another language a decade later for another database-backed application.
- kenshaw 10y agoWe released a tool, xo, that generates safe and idiomatic Go code from a database schema that does not make any use of an ORM. I have been meaning to add support for generating code for other languages but have not yet had time to do that. That said, it is very easy and very straightforward to do so. Check it out: https://github.com/knq/xo https://github.com/knq/xo
- kawera 10y agoxo is great, we've used it a few times for existing databases, great timesaver. Thanks!
- moosingin3space 10y agoDespite not being a huge Go fan myself, I do appreciate this aspect of Go's database/sql and sqlx packages.