Closed janowicz closed 10 years ago
I don't think injectables are the right solution here, but I know what you mean.
I think the absolute best solution is something like SQLAlchemy's connection pooling. But if we don't want to depend on sqlalchemy we can try to sort out our own solution.
Sounds good. When you get the chance, it'd be great if you could help us tweak things in the absence of using SQLAlchemy. Right now, the only place we use get_injectable('conn'/'cur') is in the exec_sql and db_to_df functions to get a global connection. Was using get_injectable like how in UrbanSim we register things in assumptions.py.
Code currently uses sim.add_injectable / sim.get_injectable to register database conn/cur objects so that conn/cur don't need to be passed around as function parameters.