A null repository view
April 15th, 2005 at 3:39 pm (3 years, 2 months ago) by Andi Vajda under chandlerdbIn order to support Phillip Eby’s proposal for a python-based Schema API, I added support for a repository-less repository view.
This so-called null repository view points back to no repository and is essentially an in-memory cache of items. Some of its persistence methods such as refresh() or commit() are setup to raise an error. Others, such as _loadItem() are stubbed out to return None and others such as queryItems() are implemented to work only with the in-memory items the view caches. The null repository view is fully API compatible with regular repository views and should make it very easy to write unit tests that need no persistence support. These unit tests should run quite a bit faster since no repository creation and committing is needed. It turns out that creating a persistence-capable in-memory Berkeley DB is not free. The null repository view cuts this cost out completely.







