couchdb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Paul Davis <paul.joseph.da...@gmail.com>
Subject View Internal API
Date Tue, 24 Nov 2009 05:14:14 GMT
Dev People,

Its no secret that I've been trying to find a reason to delete all of
the temp_view logic in the view code. I was just discussing the
internal view API with Adam Kocoloski on IRC and it hit me that with
the index-filename-from-md5 patch that Chris Anderson landed a while
ago could make it all go away.

The proposed API would be something like:

couch_view:get_view(DesignDoc) -> #view{}

Where DesignDoc is the ErlJSON representation of that design doc. Then
temp_views would just create the ErlJSON representation (without
saving that doc in the DB) and pass it to the view update mechanics.
Cleaning up old temp views would then just use the existing cleanup
mechanism we already have in place.

AFAICT, this doesn't introduce any sort of oddities that don't already
exist and provides better semantics for promoting a temp_view to a
permanent view because the index wouldn't need to be rebuilt.

Then again I'm a bit tired so I could be off my rocker. Anyone see
anything obviously wrong?

Paul Davis

Mime
View raw message