Refactoring out some more common code from SQLQueryComposer.