func TestDeleteStatement(t *testing.T) {
	relation := nodes.Relation("table")
	stmt := nodes.DeleteStatement(relation)
	expected := `DELETE FROM "table" `
	if got, _ := sql.Accept(stmt); expected != got {
		t.Errorf("TestDeleteStatement was expected to return %s, got %s", expected, got)
	}
}
Exemple #2
0
// DeleteManager factory methods.
func Deletion(relation *nodes.RelationNode) (deletion *DeleteManager) {
	deletion = new(DeleteManager)
	deletion.Tree = nodes.DeleteStatement(relation)
	return
}