You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have two tables that have a many to one relationship, such as the one described above. Any given user can only have a single car that is_main_car. Additionally, the first car a user gets must be the main car.
I am trying to determine how the transactional semantics work with this relationship within a Session. If I read the user, and then use the user.cars field to determine if the user has 0 cars or already has a main car, can I rely on that condition still being true when I write my new main Car row to the Cars table (assuming it is all within a single Session)?
Operating System
macOS
Operating System Details
No response
SQLModel Version
0.0.4
Python Version
3.9.7
Additional Context
No response
The text was updated successfully, but these errors were encountered:
First Check
Commit to Help
Example Code
Description
I have two tables that have a many to one relationship, such as the one described above. Any given user can only have a single car that
is_main_car
. Additionally, the first car a user gets must be the main car.I am trying to determine how the transactional semantics work with this relationship within a Session. If I read the
user
, and then use theuser.cars
field to determine if the user has 0 cars or already has a main car, can I rely on that condition still being true when I write my new mainCar
row to theCars
table (assuming it is all within a single Session)?Operating System
macOS
Operating System Details
No response
SQLModel Version
0.0.4
Python Version
3.9.7
Additional Context
No response
The text was updated successfully, but these errors were encountered: