Metadata-Version: 2.4
Name: commondao
Version: 1.0.0
Summary: Mysql toolkit
Author-email: qorzj <goodhorsezxj@gmail.com>
License: Apache-2.0
Keywords: mysql
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: mysql-connector
Requires-Dist: aiomysql
Requires-Dist: orjson
Requires-Dist: pydantic
Provides-Extra: test
Requires-Dist: flake8; extra == "test"
Requires-Dist: mypy; extra == "test"
Requires-Dist: coverage; extra == "test"
Requires-Dist: pytest; extra == "test"
Requires-Dist: pytest-cov; extra == "test"
Requires-Dist: pytest-mock; extra == "test"
Requires-Dist: pytest-asyncio; extra == "test"
Requires-Dist: types-toml; extra == "test"
Dynamic: license-file

# commondao

## How to install commondao?

```bash
pip install commondao
```

## How to use commondao?

```python
import toml
import commondao

config = {
    'host': '****',
    'port': 3306,
    'user': '****',
    'password': '****',
    'db': '****',
    'autocommit': True,
}
async with commondao.connect(**config) as db:
    await db.save('tbl_user', {'id': 1, 'name': 'John Doe'})
    user = await db.get_by_key_or_fail('tbl_user', key={'id': 1})
    print(user['name'])  # Output: John Doe

```
