Active Record style ORM for Go

787 views
Skip to first unread message

Brenden

unread,
Dec 7, 2013, 4:48:38 AM12/7/13
to golan...@googlegroups.com
I'm new to Go and I noticed somewhat of an aversion toward ORMs as all of the database related packages I've found are more like function wrappers for SQL queries. I know the limitations included in O/R mapping, but I feel it provides an effective layer of abstraction and flexibility to my code. So I went about writing a simple proof of concept to see how it could be done in Go.

It's still VERY early in the process as I've only implemented VERY basic MySQL "insert" support, but I'd like to get some general feedback from the more experienced community members. What I'd really like feedback on is "roadmap features by example" since they're ins't much functional code to play with.

Go easy on me. I'm a young, idealistic and eager Go noob ;)

Brenden

unread,
Dec 7, 2013, 4:50:04 AM12/7/13
to golan...@googlegroups.com
I'm so nervous, I forgot the link ;) https://github.com/brendensoares/storm

Bill Hogsett

unread,
Dec 7, 2013, 6:32:31 AM12/7/13
to golan...@googlegroups.com
I am also a new Go (or is it go?) programmer.  I used Codeigniter's Active Records in my php applications and liked it.

Brenden

unread,
Dec 9, 2013, 1:34:18 AM12/9/13
to golan...@googlegroups.com
I've used Kohana before which is heavily inspired by Code Igniter.

What are your thoughts on ORM's abstraction? Do yu think ti's a good thing?

I feel  as long as you are able to make direct SQL queries via the model as needed, then ORM is a great way to cover 80% of a web apps data persistence needs.

Marcus Holmes

unread,
Dec 9, 2013, 5:55:41 AM12/9/13
to golan...@googlegroups.com
It looks nice... it's not a small job to get this complete and tested, though! There's a lot of use cases you'll need to consider...

I'm not a fan of ORM because (basically) it always ends up with me having to warp my data to fit my objects or vice versa. For example: you can't use composite structs if they're in an ORM, and composition is a key element of Go's struct usage.

But don't let me stop you... go find a way of doing it better :)

Brenden

unread,
Dec 9, 2013, 10:16:57 PM12/9/13
to golan...@googlegroups.com
Thanks for the perspective and kind words Marcus. Curious though, why can't you use structs composed of other sturcts if you use ORM?
Reply all
Reply to author
Forward
0 new messages