More Database And Schema Relationships - FastAPI Beyond CRUD (Part 15)

preview_player
Показать описание
More Database And Schema Relationships
In this video, we enhance our SQLModel models by establishing additional database relationships within our application. We demonstrate how to efficiently retrieve data leveraging these relationships, with a specific focus on user reviews.

SOURCE CODE:

COURSE WEBSITE:

PLEASE DONATE TO THE CHANNEL THROUGH:
BUY ME A COFFEE:

PATREON:

You can also consider Becoming a member of this channel.

FOLLOW ME:

X:

GITHUB:

Timestamps:
(00:00:00) Intro
(00:00:57) Fixing MissingGreenlet Error
(00:05:59) A look at the database structure
(00:06:53) Re-organizing the database models
(00:11:27) Creating the Review table
(00:16:38) Relationship attributes for books, users and reviews
(00:19:26) Creating the review router
(00:22:18) Create the reviews service class
(00:34:53) Create the API endpoint for adding a book review
(00:48:34) Modifying Pydantic schema for relationships
(00:54:10) Conclusion
Рекомендации по теме
Комментарии
Автор

Hi guys, this video was not really intended to be this long but I hope you go through it to the end. Please help me click the like button, Thanks for watching.

SsaliJonathan
Автор

Hi Ssali Johnathan, thanks for putting together an amazing tutorial. I'm really enjoying and learning a lot from these series. I have the following question, I'm working on a booking system, so the scale of the project will be quite large. When creating the data models, is it best to keep them in separate folders or do what you showed and keep them all in the same file? I need to create many relationships between many tables. I was wondering which would be easier to maintain. Thanks.

emmanuelalder
Автор

How do you design the database for your use case? and where do you draw database diagrams before implementing them?

mahmoudkhaled
Автор

Hi again can you please explain why you pass user, and book directly as foreign key Instead user.uid, book.uid in new_review_book()

nirabindudas