Open
Description
Description
from litestar.contrib.sqlalchemy.repository import SQLAlchemyAsyncRepository # Async CRUD operations
Give following warning:
..\..\.conda\envs\backery-back-end\Lib\site-packages\litestar\contrib\sqlalchemy\repository\__init__.py:37
Lib\site-packages\litestar\contrib\sqlalchemy\repository\__init__.py:37: DeprecationWarning: Import of deprecated import 'litestar.contrib.sqla
lchemy.repository.SQLAlchemyAsyncRepository'. Deprecated in litestar 2.12. This import will be removed in 3.0. importing SQLAlchemyAsyncRepository from 'litestar.contrib.sqlalchemy.repository' is deprecated, please import it from 'litestar.plugins.sqlalchemy.repository' instead
warn_deprecation(
-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
However, change from
from litestar.contrib.sqlalchemy.repository import SQLAlchemyAsyncRepository # Async CRUD operations
# to
from litestar.plugins.sqlalchemy.repository import SQLAlchemyAsyncRepository # Async CRUD operations
Outputs:
sql_manage\relation.py:22: in <module>
from litestar.plugins.sqlalchemy.repository import SQLAlchemyAsyncRepository # Async CRUD operations
E ModuleNotFoundError: No module named 'litestar.plugins.sqlalchemy.repository'; 'litestar.plugins.sqlalchemy' is not a package
I have to use
from litestar.plugins.sqlalchemy import repository # Async CRUD operations
then call it like
repository.SQLAlchemyAsyncRepository
URL to code causing the issue
No response
MCVE
Steps to reproduce
- Go to '...'
- Click on '....'
- Scroll down to '....'
- See error
Screenshots
No response
Logs
Litestar Version
I am running
litestar 2.15.1
litestar-htmx 0.4.1
Platform
- Linux
- Mac
- Windows
- Other (Please specify in the description above)