How can I control retry times when I use sql_error_handler to retry SQL execution?
Figure out a way myself. Sample codes:

``` python
import logging

from playhouse.pool import PooledMySQLDatabase
from peewee import OperationalError


logger = logging.getLogger(__name__)


class RetryPooledMySQLDatabase(PooledMySQLDatabase):

    def sql_error_handler(self, exception, sql, params, require_commit):
        if isinstance(exception, OperationalError):
            self.close()
            self.connect()
        return True

    def execute_sql(self, sql, params=None, require_commit=True):
        retry_times = 0
        max_retry_times = 3
        while True:
            try:
                return super(RetryPooledMySQLDatabase, self).execute_sql(
                    sql, params, require_commit
                )
            except OperationalError:
                if retry_times >= max_retry_times:
                    logger.warning(
                        'Maximum retry times(%s) exceeded, give up retrying.',
                        max_retry_times,
                    )
                    raise

                retry_times += 1
                logger.warning(
                    'Executing SQL(%s), params(%s) error, retrying %s/%s time',
                    sql,
                    params,
                    retry_times,
                    max_retry_times,
                )
```

I am using the RetryDatabase example code I found in peewee test cases.

https://github.com/coleifer/peewee/blob/db328731034e45fb4f8a1a2a4a562da1dc0d1f23/playhouse/tests/test_database.py#L183

The problem is that I want to control retry times manually. How can I do that in a nice way?
