'Perform a bulk delete query.
Deletes rows matched by this query from the database.
:param synchronize_session: chooses the strategy for the removal of
matched objects from the session. Valid values are:
``False`` - don\'t synchronize the session. This option is the most
efficient and is reliable once the session is expired, which
typically occurs after a commit(), or explicitly using
expire_all(). Before the expiration, objects may still remain in
the session which were in fact deleted which can lead to confusing
results if they are accessed via get() or already loaded
collections.
``\'fetch\'`` - performs a select query before the delete to find
objects that are matched by the delete query and need to be
removed from the session. Matched objects are removed from the
session.
``\'evaluate\'`` - Evaluate the query\'s criteria in Python straight
on the objects in the session. If evaluation of the criteria isn\'t
implemented, an error is raised.  In that case you probably
want to use the \'fetch\' strategy as a fallback.
The expression evaluator currently doesn\'t account for differing
string collations between the database and Python.
:return: the count of rows matched as returned by the database\'s
"row count" feature.
This method has several key caveats:
* The method does **not** offer in-Python cascading of relationships - it
is assumed that ON DELETE CASCADE/SET NULL/etc. is configured for any foreign key
references which require it, otherwise the database may emit an
integrity violation if foreign key references are being enforced.
After the DELETE, dependent objects in the :class:`.Session` which
were impacted by an ON DELETE may not contain the current
state, or may have been deleted. This issue is resolved once the
:class:`.Session` is expired,
which normally occurs upon :meth:`.Session.commit` or can be forced
by using :meth:`.Session.expire_all`.  Accessing an expired object
whose row has been deleted will invoke a SELECT to locate the
row; when the row is not found, an :class:`~sqlalchemy.orm.exc.ObjectDeletedError`
is raised.
* The :meth:`.MapperEvents.before_delete` and
:meth:`.MapperEvents.after_delete`
events are **not** invoked from this method.  Instead, the
:meth:`.SessionEvents.after_bulk_delete` method is provided to act
upon a mass DELETE of entity rows.
.. seealso::
:meth:`.Query.update`
:ref:`inserts_and_updates` - Core SQL tutorial'

def delete(self, synchronize_session='evaluate'):

    delete_op = persistence.BulkDelete.factory(self, synchronize_session)
    delete_op.exec_()
    return delete_op.rowcount
