Hacker News new | ask | show | jobs
by sunfmin 4937 days ago
I actually want to see this:

    hd.Where("name = ?", name).Where("category = ?", category)

So that you can do conditional where easily, for example:

    hd = hd.Where("name = ?", name)
    if category != "" {
        hd = hd.Where("category = ?", category)
    }
But It doesn't seem to support this?
2 comments

As for now, you have to specify the complete where clause

    hd.Where("name = ? AND category = ?", name, category)
but it should be quite trivial to add the chaining you pointed out.