示例#1
0
func SQLAND(args ...KV) sq.Condition {
	sqArgs := make([]sq.P, len(args))
	for i, arg := range args {
		sqArgs[i] = sq.P{arg.Key, arg.Value}
	}
	return sq.AllEQ(sqArgs...)

}
示例#2
0
func WherePK(pkCols []string) sq.Condition {
	wheres := make([]sq.P, len(pkCols))
	for i, col := range pkCols {
		wheres[i] = sq.P{col, nil}
	}
	return sq.AllEQ(
		wheres...,
	)
}
示例#3
0
// Select is for the main use case of a series of columns that
// all must match:
// Example:
//		err := group.Select(d, group, sq.P{"gid", 1}, sq.P{"planet", 2})
func Select(d db.DBer, group SelectGrouper, conditions ...sq.P) error {
	where := sq.AllEQ(conditions...)
	return SelectWhere(d, group, where)
}