Replies: 3 comments 1 reply
-
Try using the SQLAlchemy text() function (see here: https://www.tutorialspoint.com/sqlalchemy/sqlalchemy_core_using_textual_sql.htm) alongside the old style Session.execute() function. So your example would look something like:
|
Beta Was this translation helpful? Give feedback.
-
+1 to having an officially supported way of running SQL directly. I've had success with something like this to at least hide the deprecation warning: sql = "SELECT ......."
await super(AsyncSession, async_session).execute(text(sql)) Haven't tested it, but I assume similar would work for non-async: sql = "SELECT ......."
super(Session, session).execute(text(sql)) |
Beta Was this translation helpful? Give feedback.
-
The absence of proper overload for |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
First Check
Commit to Help
Example Code
Description
The previous version of sqlmodel was executable, but the new version suggested that I use exec. However, I found that exec cannot implement my original function. How should I modify it
Operating System
Windows
Operating System Details
No response
SQLModel Version
0.0.14
Python Version
Python 3.11.2
Additional Context
No response
Beta Was this translation helpful? Give feedback.
All reactions