Тёмный
No video :(

API pagination with FastAPI and SQLAlchemy 

microapis
Подписаться 1,5 тыс.
Просмотров 2,2 тыс.
50% 1

Опубликовано:

 

21 авг 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 4   
@ljptech
@ljptech 3 месяца назад
It was really nice to meet you today Jose! I will cheer for you business and your very bright future ahead.
@microapis
@microapis 3 месяца назад
Thank you was a great pleasure meeting you too and I really enjoyed our conversation! Wish you the very best with your projects too and looking forward to seeing them grow. Hope we can see each other again!
@grahortarg9933
@grahortarg9933 4 месяца назад
I still have a question - how to do count with filters?
@microapis
@microapis 2 месяца назад
Thank you for your question! You'd follow the same approach shown in the video, only applying the filters first. Here's an example: @router.get("/jobs", response_model=ListJobs) def list_jobs(contract_type: ContractTypeEnum | None = None,): with session_maker() as session: query = select(Job) if contract_type: query = query.where(Job.contract_type == contract_type.value) count = session.execute( select(func.count()).select_from(query.subquery()) ).scalar_one() This endpoint returns a list of jobs and allows you to filter by contract type. The filter is optional and None by default, so first we check if it's set, and if so, we apply the filter to the query. Once we've filtered the result set, we count the items. Hope this helps, if you have any more questions please let me know!
Далее
API Security Fundamentals [2023]
50:35
Просмотров 1,6 тыс.
Top 7 Ways to 10x Your API Performance
6:05
Просмотров 324 тыс.
Rest API - Best Practices - Design
15:50
Просмотров 105 тыс.
How to Use Async SQLAlchemy in FastAPI
15:20
Просмотров 27 тыс.
Databases & SQLAlchemy - Flask Tutorial Series #7
33:58
FastAPI - Тестируем API с pytest #10
23:41
Просмотров 29 тыс.
HTMX and the View Transitions API
20:21
Просмотров 14 тыс.