Asmysql

Latest version: v1.0.0

Safety actively analyzes 681866 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

1.0.0

Features

1. Update the supported Python version range, with a minimum support of 3.9.
2. Update the documentation content.

0.2.0

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)

0.1.4

Features

1. `AsMysql` supports asynchronous context manager.

python
import asyncio
from asmysql import AsMysql

class TestAsMysql(AsMysql):
async def get_users(self):
result = await self.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)

async def main():
async with TestAsMysql() as mysql:
await mysql.get_users()

if __name__ == '__main__':
asyncio.run(main())


2. Replaced exceptions in `connection` with `ConnectionError`.

0.1.1

Features

> Added `Result.err_msg` to return a detailed string of the exception error.

0.1.0

Breaking Changes

Features

> 1. `asmysql` is a simplified wrapper library around `aiomysql`.
> 2. Supports automatic management of MySQL connection pools and reconnection mechanism.
> 3. Automatically captures and handles `MysqlError` globally.
> 4. Separates statement execution and data retrieval.
> 5. Directly integrates the `AsMysql` class for logical development.

Internal

> Initialized the project, with the development environment managed using `poetry`.

Links

Releases

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.