extract SQL statement in rake file