Having discussed it with Nigel, this is fine for now - it's just used for testing purposes. In the future it will no longer be required when 'build' is refactored, so there are two separate methods (build, and get_sql). Ticket 4451 was created for this.