Re: [sqlalchemy] Query object modification

2023-04-13 Thread Mike Bayer
On Thu, Apr 13, 2023, at 4:14 PM, Luis Del Rio IV wrote: > Mike, > > Would this select query be able to get our aggregated data? > > query = > select(func.max(DataModel.value)).select_from(_query.subquery()).group_by( > func.date_format(DataModel.timestamp, "%Y-%m-%d %H")

Re: [sqlalchemy] Query object modification

2023-04-13 Thread Mike Bayer
On Thu, Apr 13, 2023, at 1:13 PM, Peter Harrison wrote: > Thanks Mike, > > Ideally we'd prefer to find a solution via Graphene-SQLAlchemy. Unfortunately > we don't have the luxury of creating our own query when interacting with > Graphene-SQLAlchemy. > > So the key question for us is, can

Re: [sqlalchemy] Query object modification

2023-04-13 Thread Luis Del Rio IV
Mike, Would this select query be able to get our aggregated data? query = select(func.max(DataModel.value)).select_from(_query .subquery()).group_by( func.date_format(DataModel.timestamp, "%Y-%m-%d %H") ) We tried this route but are now getting this error

Re: [sqlalchemy] Query object modification

2023-04-13 Thread Peter Harrison
Thanks Mike, Ideally we'd prefer to find a solution via Graphene-SQLAlchemy. Unfortunately we don't have the luxury of creating our own query when interacting with Graphene-SQLAlchemy. So the key question for us is, can you modify an existing sqlalchemy.orm.query.Query object to insert a

Re: [sqlalchemy] Access other columns in a custom type

2023-04-13 Thread Mike Bayer
On Thu, Apr 13, 2023, at 6:10 AM, Hussein Samadi wrote: > Hi everyone. > I'm creating a new SQLA custom type using TypeDecorator base class. Is it > possible to have access to the value of other fields in > "process_result_value" method? Generally, is it possible to create a custom > type

[sqlalchemy] Access other columns in a custom type

2023-04-13 Thread Hussein Samadi
Hi everyone. I'm creating a new SQLA custom type using TypeDecorator base class. Is it possible to have access to the value of other fields in "process_result_value" method? Generally, is it possible to create a custom type that have access to other column's data in the de-serialization