def prepare_and_load(self): """ Gets a connection set up. """ # Instantiate the connection to Postgres. self._db = txPGDictConnection() conn_info = get_db_connection_kwargs(db_mode=self._db_mode) yield self._db.connect(**conn_info)
def prepare_and_load(self): """ Prepares the store for duty, then loads all objects from the DB into the object store. """ # Just in case this is a code reload. self.store._accounts = {} # Instantiate the connection to Postgres. self._db = txPGDictConnection() conn_info = get_db_connection_kwargs(db_mode=self._db_mode) yield self._db.connect(**conn_info)