Metadata-Version: 2.3
Name: lush-sqlalchemyx
Version: 0.4.1
Summary: SQLAlchemy helpers (DAL) and async MySQL managers, with some web frameworks integrations
Author: straydragon
Author-email: straydragon <straydragonl@foxmail.com>
License: Apache-2.0
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3.10
Requires-Dist: sqlalchemy>=2.0.21
Requires-Dist: pydantic>=2.3.0,<3.0.0
Requires-Dist: typing-extensions>=4.12.2
Requires-Dist: lush-pydanticx>=0.1.0
Requires-Dist: lush-stdx>=0.1.0
Requires-Dist: lush-dal-protocol>=0.2.2
Requires-Dist: sqlalchemy[asyncio]>=2.0.43 ; extra == 'asyncio'
Requires-Dist: flask-sqlalchemy>=3.1.1 ; extra == 'flask'
Requires-Python: >=3.10
Provides-Extra: asyncio
Provides-Extra: flask
Description-Content-Type: text/markdown

# lush-sqlalchemyx

SQLAlchemy(偏 asyncio) 的一组工具和封装. 这里的东西偏“工程向”: 解决常见的 session 管理、只读会话、以及一些重复写到吐的样板代码.

## 例子

一个最小的异步 MySQL 管理器:

```python
import asyncio

from lush_sqlalchemyx.mgrs.mysql.manager import AsyncMySQLManager

async def main() -> None:
    mgr = AsyncMySQLManager("mysql+aiomysql://<user>:<password>@127.0.0.1:3306/<dbname>")
    ok = await mgr.health_check()
    print(ok)

    await mgr.close()


asyncio.run(main())
```

## 开发

```bash
uv sync -p 3.10 --frozen
uv run -p 3.10 pytest
```
