function something(db_obj)
print db_obj.getSql() #shows SQL built so far
db_obj.having('SOMETHING = SOMETHING ELSE')
db_obj.fromClause(this.bizarreCaseStatement()
db_obj.order(this.weirdoOrderClauseThatReferencesCaseStatement());
return db_obj
When I start working with db_obj, it might come from some other part of the application for which the "basic ORM" was just fine.Now I want to add some weirdo custom stuff in but I can't - I have to go back to the part of the application that produced db_obj in the first place and refactor that to use custom SQL.
It's one or the other.