Suppose I have a PostgreSQL backend and I have the following class:
class Foo(Base):
id = Column(Integer, primary_key=True)
updated_at = Column(DateTime)
and I do
foo = Foo(updated_at=func.now())
session.add(foo)
session.flush()
foo.id # this is already loaded, no additional query emitted foo.updated_at # this is not loaded, will cause an additional query to be emitted
Is it possible to have the SQLAlchemy ORM fetch the actual value of updated_at as part of the INSERT...RETURNING statement like it does for id, instead of leaving it unloaded and having to issue a second query when I access it?
Jack