def execute(self, sql, params=[]):
        # Log the command we're running, then run it
        logger.debug("%s; (params %r)", sql, params, extra={'params': params, 'sql': sql})
        if self.collect_sql:
            ending = "" if sql.endswith(";") else ";"
            if params is not None:
                self.collected_sql.append((sql % tuple(map(self.quote_value, params))) + ending)
            else:
                self.collected_sql.append(sql + ending)
        else:
            with self.connection.cursor() as cursor:
                cursor.execute(sql, params)
Executes the given SQL statement, with optional parameters.
dataset/ETHPy150Open django/django/django/db/backends/base/schema.py/BaseDatabaseSchemaEditor.execute