Exemple #1
0
func TestStar(t *testing.T) {
	star := nodes.Star()
	result, _ := sql.Accept(star)
	if "*" != result {
		t.Errorf("TestStar was expected to return *, got %s", result)
	}
}
Exemple #2
0
// ToSql calls a visitor's Accept method based on the manager's SQL adapter.
func (self *SelectManager) ToSql() (string, error) {
	for _, core := range self.Tree.Cores {
		if 0 == len(core.Projections) {
			core.Projections = append(core.Projections, nodes.Attribute(nodes.Star(), core.Relation))
		}
	}

	if nil == self.adapter {
		self.adapter = "to_sql"
	}

	return VisitorFor(self.adapter).Accept(self.Tree)
}