Re: [sqlalchemy] Re: from_statement NOW()

2018-07-05 Thread Danila Ganchar
ments of what > > you are doing. like what the current time is from now(), what are > > the rows in the table without any WHERE criterion, etc. > > > > > > On Fri, Jun 29, 2018 at 11:41 AM, Danila Ganchar > > > wrote: > >> Thank you for your feedback

Re: [sqlalchemy] Re: from_statement NOW()

2018-06-29 Thread Danila Ganchar
meout=1, >> last_receive_time=datetime.datetime.now() )) >> >> session.commit() >> >> import time >> time.sleep(1) >> >> query = session.query(User)\ >> .from_statement(text(""" >>SELECT * >> FROM tes

Re: [sqlalchemy] Re: from_statement NOW()

2018-06-27 Thread Danila Ganchar
Ok. I ran the script 10 times on a clean table. Now I run raw sql: SELECT * FROM test_user WHERE (last_receive_time + INTERVAL '1 second' * timeout) < NOW(); The result: 10 records. Now I run script one more time. Still 0 records using from_statement. amount records using NOW() = 0 As I

[sqlalchemy] from_statement NOW()

2018-06-26 Thread Danila Ganchar
I found strange behavior. I have a model: class User(Base): __tablename__ = 'test_user' id = Column(Integer, primary_key=True) timeout = Column(Integer) last_receive_time = Column(TIMESTAMP) I have a next script: # run several times session.add( User( timeout=1,