def compile_delete(self, query):
        """
        Compile a delete statement into SQL

        :param query: A QueryBuilder instance
        :type query: QueryBuilder

        :return: The compiled update
        :rtype: str
        """
        table = self.wrap_table(query.from__)

        if isinstance(query.wheres, list):
            wheres = self._compile_wheres(query)
        else:
            wheres = ""

        if query.joins:
            joins = " %s" % self._compile_joins(query, query.joins)

            sql = "DELETE %s FROM %s%s %s" % (table, table, joins, wheres)
        else:
            sql = "DELETE FROM %s %s" % (table, wheres)

        sql = sql.strip()

        if query.orders:
            sql += " %s" % self._compile_orders(query, query.orders)

        if query.limit_:
            sql += " %s" % self._compile_limit(query, query.limit_)

        return sql
Compile a delete statement into SQL

        :param query: A QueryBuilder instance
        :type query: QueryBuilder

        :return: The compiled update
        :rtype: str