def transmogrify(self, sql, *args, **kwargs): compiled = qcompile(sql, paramstyle=self.db.driver.PARAM_STYLE) return compiled.apply(*args, **kwargs)