Replies: 2 comments
-
Potentially related discussions (I've tried all these already): #613 - this does not work |
Beta Was this translation helpful? Give feedback.
-
My mistake, this code does all work. I was mistakenly running |
Beta Was this translation helpful? Give feedback.
-
First Check
Commit to Help
Example Code
Description
It does not seem possible to have cascade deletions in SQLModel, and (cascading) deletions are not documented in the official docs.
In the above code I have tried to match SQLModel and SQLAlchemy up as closely as possible. I create a Parent with three Children. On deletion of the Parent, in SQLModel, the cascade does not delete the children. It does in SQLAlchemy.
Any help with resolving this issue or my misunderstanding of the cascade options in SQLModel would be much appreciated.
Operating System
macOS
Operating System Details
MacOS Sonoma 14.4.1
SQLModel Version
0.0.18
Python Version
3.12.1
Additional Context
No response
Beta Was this translation helpful? Give feedback.
All reactions