예제 #1
0
func TestAssignment(t *testing.T) {
	assignment := nodes.Assignment(1, 2)
	expected := "1 = 2"
	if got, _ := sql.Accept(assignment); expected != got {
		t.Errorf("TestAssignment was expected to return %s, got %s", expected, got)
	}
}
예제 #2
0
// To alters the trees Values slice to be an AssignmentNode, containing the
// column from Set at the same index of the value.
func (self *UpdateManager) To(values ...interface{}) *UpdateManager {
	for index, value := range values {
		if index < len(self.Tree.Values) {
			column := self.Tree.Values[index]
			self.Tree.Values[index] = nodes.Assignment(column, value)
		}
	}

	return self
}