uriyyo / fastapi-pagination

FastAPI pagination 📖
https://uriyyo-fastapi-pagination.netlify.app/
MIT License
1.15k stars 132 forks source link

Using SQLAlchemy #1162

Closed limzyishere closed 2 months ago

limzyishere commented 4 months ago

Hello! Simple question if you wouldn't mind answering. I was reading the documentation and it states.

For instance, if you use SQLAlchemy you can use paginate from fastapi_pagination.ext.sqlalchemy module. What are the consequences of using paginate from fastapi_pagination instead? It will load all the data in memory before paginating it? is my understanding correct?

Thank you!

hasansezertasan commented 4 months ago

Every paginate function requires some configuration to work with related ORM/ODM. The paginate function from fastapi_pagination is not meant to be used with SQLAlchemy.

uriyyo commented 3 months ago

@limzyishere Sorry for long response. Do you still have a question or @hasansezertasan answered it?

uriyyo commented 2 months ago

@limzyishere I'm closing this issue. Please, reopen it in case you still have questions.