Can't return result from session.exec directly (have to assign to an intermediate variable)? #984
Unanswered
EarthStoodStill
asked this question in
Questions
Replies: 1 comment
-
p.s., I suppose the Pydantic types are being constructed from the result data -- maybe that's the answer. I wasn't expecting that to be necessary since I passed the type to the embedded select(...) (so maybe they don't come back as my custom Pyndatic types from session.exec(...)?) |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
First Check
Commit to Help
Example Code
Description
Just trying to get back all "organizations" instead of a single one. Something about my code structure in the former code is maybe returning from session.exec(...) before it has data, or is breaking it (but this is synchronous, so I wouldn't think that's the case)? I noticed you always assign to an intermediate variable before returning anything, so hopefully you know why/can point me to something I can read/Google about.
Operating System
Linux
Operating System Details
No response
SQLModel Version
0.0.18
Python Version
3.12
Additional Context
Thank you! Sorry if this is just a dumb variable scope/Python code structure issue -- I'm a bit rusty atm.
Beta Was this translation helpful? Give feedback.
All reactions