コード例 #1
0
func TestHaving(t *testing.T) {
	having := nodes.Having(1)
	expected := "HAVING 1"
	if got, _ := sql.Accept(having); expected != got {
		t.Errorf("TestHaving was expected to return %s, got %s", expected, got)
	}
}
コード例 #2
0
ファイル: select_manager.go プロジェクト: smillaedler/codex
// Sets the Context's Having member to the given expression.
func (self *SelectManager) Having(expr interface{}) *SelectManager {
	if _, ok := expr.(string); ok {
		expr = nodes.Literal(expr)
	}

	self.Context.Having = nodes.Having(expr)
	return self
}