News for hackers. Stuff that matters.
Re:A RESTful Micro-Framework in Go by lann on Sunday January 26, 2014 @01:44PM (#7126220)
> SQL

I'm working on an arel-esque fluent SQL generator now: https://github.com/lann/squirrel

I'll release it once I'm a little more confident in the interface. Currently you can do things like this:

  rows, err :=
        Select("col").
        From("tab").
        Where("x = ?", 1).
        RunWith(db).Query()
Re:A RESTful Micro-Framework in Go by wc- on Monday January 27, 2014 @01:43AM (#7129131)
> I'll release it once I'm a little more confident in the interface.

Release it now! I've said the same thing in the past about some code I was working on. Add a little readme, explicitly say it is a work in progress, and get it out there. At the very least the rush of publicizing something will push your drive to work on this codebase, and you might even gain some contributors. I'd rather use a repo that is obviously a work in progress but has active contributions from the creator over some more 'complete' but stagnant repo any day.

Re:A RESTful Micro-Framework in Go by lann on Monday January 27, 2014 @03:04AM (#7129326)
Don't worry, I'm not shooting for anything like perfection. I released another library that this builds on just last week: https://github.com/lann/builder
Re:A RESTful Micro-Framework in Go by lann on Monday January 27, 2014 @10:13PM (#7135084)
Just released (MIT license); have at it.
Re:A RESTful Micro-Framework in Go by rckclmbr on Sunday January 26, 2014 @03:53PM (#7126845)
Honest question... how is this different from, say:

rows, err := db.execute("SELECT col FROM tab WHERE x = ?", 1);

Re:A RESTful Micro-Framework in Go by lann on Sunday January 26, 2014 @04:09PM (#7126920)
Primarily because you can reuse partial queries and add conditional where clauses more easily.

There are other features I haven't shown here as well, like building an IN expression with placeholders from a slice.

Re:A RESTful Micro-Framework in Go by mercurial on Monday January 27, 2014 @08:52AM (#7130261)
It's harder to shoot yourself in the foot by mistyping SELECT, for instance, and it's clearly more composable.