Re: [sqlalchemy] How to infer the ORM model class from an update()/insert() object?

2022-03-26 Thread Mike Bayer
the Project model is actually in there, but not in a public API place (this is not the solution, but look inside of table._annotations to see it). The closest public API we have for this very new API right now is the Query equivalent of column_descriptions, which is available on the select()

[sqlalchemy] How to infer the ORM model class from an update()/insert() object?

2022-03-26 Thread mkmo...@gmail.com
Hello, How can I infer the ORM model class from an update (or insert, or delete) function result? upd = update(Project).values(name='foo').where( Project.id == 1 ) def my_library_function(session, upd): result = session.execute(upd) # how to get the Project ORM model here, using