Features
1. Fixed the handling of the `echo` parameter in `aiomysql`.
2. Added the `echo_sql_log` parameter to the `AsMysql` class, used to control whether `aiomysql` outputs the executed SQL statements (default is False).
python
from asmysql import AsMysql
class TestAsMysql(AsMysql):
This allows controlling whether the executed SQL statements in aiomysql
are output to Logging.logger.
echo_sql_log = True
Of course, the `echo_sql_log` parameter can also be passed when instantiating AsMysql.
async def main():
async with TestAsMysql(echo_sql_log=True) as mysql:
result = await mysql.client.execute('select user, authentication_string, host from mysql.user')
if result.err:
print(result.err)
else:
async for item in result.iterate():
print(item)