First Check
Commit to Help
Example Code
Example code multiple update data
def update_heroes():
with Session(engine) as session:
statement = select(Hero).where(Hero.name == "Spider-Boy") #
results = session.exec(statement) #
hero_1 = results.one() #
print("Hero 1:", hero_1) #
statement = select(Hero).where(Hero.name == "Captain North America") #
results = session.exec(statement) #
hero_2 = results.one() #
.....
Description
Based on the documentation, when we want to update multiple data. We need to do N+1 query:
doc multiple update
Are there any other way to do it with only select needed data once?
Operating System
macOS
Operating System Details
No response
SQLModel Version
0.0.4
Python Version
3.9
Additional Context
No response
First Check
Commit to Help
Example Code
Description
Based on the documentation, when we want to update multiple data. We need to do N+1 query:
doc multiple update
Are there any other way to do it with only select needed data once?
Operating System
macOS
Operating System Details
No response
SQLModel Version
0.0.4
Python Version
3.9
Additional Context
No response