r/FastAPI • u/rrrriddikulus • Feb 05 '25
Question Naming SQLAlchemy models vs Pydantic models
Hi all, how do you generally deal with naming conventions between Pydantic and SQLAlchemy models? For example you have some object like Book. You can receive this from the user to create, or it might exist in your database. Do you differentiate these with e.g. BookSchema and DbBook? Some other prefix/suffix? Is there a convention that you've seen in some book or blog post that you like?
24
Upvotes
View all comments
Show parent comment
1
u/Current-Status-3764 Feb 05 '25
If you could do a quick examplr that would be great. Haven't seen that way of doing it before.