4 ms·
I actually want to see this: hd.Where("name = ?", name).Where("category = ?", category) So that you can do conditional where easily, for example: hd
by sunfmin 14y 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?
- eaigner 14y agoAs 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.
- eaigner 14y agoQuick fix: https://github.com/eaigner/hood/commit/85948f72646e6703af09e4a180a937a4cbfc4087 https://github.com/eaigner/hood/commit/85948f72646e6703af09e...