> For the complete documentation index, see [llms.txt](https://docs.arkannis.net/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.arkannis.net/programming/python/modules/pydantic-model-vs-sqlalchemy-model.md).

# Pydantic Model vs SQLAlchemy Model

### Pydantic Model

* Schema/Pydantic Models define the structure of a request & response
* This ensures that when a user wants to create a post, the request will only go through if has a "title" and "content" in the body (as defined via Pydantic)&#x20;

![](/files/duf7FYD5c07MCMZnIlfs)

### SQLAlchemy Model

* Responsible for defining the columns of our "posts" table within Postgres
* Is used to query, create, delete, update entries within the database

![](/files/BV3ZmaiXuxDmCBOKGMfQ)
