Description
https://github.com/molpako/Architecture-Patterns-with-Python
Hello, I’m using this book to study DDD. At the same time, I wanted to incorporate recent trends into my learning, so I started studying with FastAPI and sqlc.
However, since sqlc doesn’t provide object-to-table mapping functionality, I’m unsure how to solve this, and I need help.
In the book, SQLAlchemy’s mapper is used to bind the domain model to the table, and storage changes are accomplished by modifying the aggregate. sqlc is an ORM specialized in generating Go objects from raw SQL, so it doesn’t have the mapping functionality that the book uses.
Would it be appropriate to implement the functionality in the repository to reflect changes in the domain class to the DB, and then call that functionality in the service layer after making changes to the domain class? Or is it impossible to achieve DDD without an ORM that has mapping functionality?