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

2022-03-27 Thread Mike Bayer
On Sun, Mar 27, 2022, at 2:56 PM, mkmo...@gmail.com wrote: > Hi Mike, > > I'm writing a library that uses SQLAlchemy. The user will pass the library an > update, and the library will add a RETURNING clause for postgresql users, and > then return the model back to the user. The idea here is to

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

2022-03-27 Thread mkmo...@gmail.com
Hi Mike, I'm writing a library that uses SQLAlchemy. The user will pass the library an update, and the library will add a RETURNING clause for postgresql users, and then return the model back to the user. The idea here is to update and select the row in a single database call, instead of the

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

2022-03-27 Thread Mike Bayer
On Sun, Mar 27, 2022, at 2:08 PM, mkmo...@gmail.com wrote: > Hi Mike, > > Thanks. Should I use column_descriptions[0]['type'] ? yup, that should be pretty consistent in this case. I've implemented most of an actual feature for this but isn't committed yet at

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

2022-03-27 Thread mkmo...@gmail.com
Hi Mike, Thanks. Should I use column_descriptions[0]['type'] ? In my case, `type`, `expr` and `entity` all return the model class that I am interested in. Thanks and best regards, Matthew On Saturday, March 26, 2022 at 12:02:54 PM UTC-7 Mike Bayer wrote: > the Project model is actually in