FWIW, I recently had a similar situation and ended using 2 tables -- one as
a transaction log and the other with a constantly updated entry. While
your approach worked fine, the database performed significantly better with
2 tables because the (vast) majority of queries only needed the most
Thanks for the book reference Jonathan, it looks very useful!
--
SQLAlchemy -
The Python SQL Toolkit and Object Relational Mapper
http://www.sqlalchemy.org/
To post example code, please provide an MCVE: Minimal, Complete, and Verifiable
Example. See http://stackoverflow.com/help/mcve for a
Than you Mike and Jonathan for your replies. I will experiment with this
and let you know how it works out.
--
SQLAlchemy -
The Python SQL Toolkit and Object Relational Mapper
http://www.sqlalchemy.org/
To post example code, please provide an MCVE: Minimal, Complete, and Verifiable
Simon's answer was almost what I needed, but was missing the details about
using context.connection.scalar to run the query.
I ended up finding a very similar issue in another thread from a few months
ago
here: https://groups.google.com/d/msg/sqlalchemy/h71QfUtCCmw/U6ITbv5pFgAJ
Thank you both