I made a comment about a similar topic on an HN thread, about ActiveRecord style ORMs in Go.

> Personally I think an active record style ORM for Go like gorm is a
> poor fit for a language that doesn't come across as inherently OOP.
> Going through some of the documentation for gorm, it seems to rely
> heavily on method chaining which for Go seems wrong considering how
> errors are handled in that language. In my opinion, an ORM should be
> as idiomatic to the language as possible.

> I've used sqlx[1] before, and it feels pretty idiomatic to Go. You tag
> your structs with their respective database columns, write up a query, > and hand it to sqlx to perform the deserialisation of the data. I've
> also come across squirrel[2] too, though I haven't used it, it does
> look rather interesting.

> [1] - https://github.com/jmoiron/sqlx

> [2] - https://github.com/masterminds/squirrel

You're right, ORMs do help with modelling data, but I think the ActiveRecord approach is the wrong way of going in regards to Go.

Also, regarding database migrations in Go, I made a simple migration tool for SQL migrations. You simply write plain SQL scripts, and these get performed and logged against the database. Right now it supports SQLite, MySQL, and PostgreSQL, and you can check it out here: https://github.com/andrewpillar/mgrt.

--
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 on the web visit 
https://groups.google.com/d/msgid/golang-nuts/e269ee70-6a28-6437-dacd-ecac1d9760e4%40andrewpillar.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to