Re: [sqlalchemy] Concise, Pythonic query syntax

2017-06-16 Thread mike bayer
On 06/15/2017 04:11 PM, Bryan Jones wrote: All, While working on my SQLAlchemy-based application, I noticed an opportunity to provide a more concise, Pythonic query syntax. For example, User['jack'].addresses produces a Query for the Address of a User named jack. I had two questions 1.

Re: [sqlalchemy] How to select efficiently big amount of time series?

2017-06-16 Thread Jonathan Vanasco
On Friday, June 16, 2017 at 1:44:45 AM UTC-4, Mike Bayer wrote: If you then added and populated a column in your table called > "ten_minute_epoch" or something like that, you could avoid having to do > the math operation on every row during your SELECT (e.g. it would be > written at INSERT

[sqlalchemy] Re: How to select efficiently big amount of time series?

2017-06-16 Thread Julien MOLINA
Thank you for your help Mike I did not think about using the modulus. So in sqlalchemy, tell me if I am wrong, the idea is to have the following request MyData.query.filter(MyData.date >= date1).filter(MyData.date <= date2).filter(func.mod(func.unix_timestamp(MyData.date) ,my_interval) == 0)