couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jedediah Smith <jeded...@silencegreys.com>
Subject Re: Auto-adding additional fields on PUT/POST? (datetime stamps)
Date Tue, 02 Dec 2008 08:01:53 GMT

If validations could write, they could serve as a complete data access 
layer. They could handle meta data generation, merging, encapsulation 
(aka implementation hiding/abstraction/conversion) and essentially solve 
the partial update problem.

If merges could be handled by script functions, two-way replication 
could be completely autonomous. Plus, sloppy developers would be more 
likely to actually handle revision conflicts instead of just ignoring them.

 From what I understand of the current architecture, it's most of the 
way there. There's already a script engine, a way to store scripts 
associated with an event, a protocol for invoking them and for passing 
data back and forth. Why not just provide hooks to every part of CouchDB?

Chris Anderson wrote:
> On Mon, Dec 1, 2008 at 7:07 PM, Jason Huggins <jason@jrandolph.com> wrote:
>> On Mon, Dec 1, 2008 at 6:56 PM, Jedediah Smith
>> <jedediah@silencegreys.com> wrote:
>>> The new validation functions might be able to do this for you if they are
>>> allowed to modify the document. Whether or not they are was asked on the dev
>>> list but not answered. I hope they are as that would be endlessly useful. It
>>> would be *really* neat if a function could also handle merging for revision
>>> conflicts.
> 
> I'm not sure about changing documents -- I think it would be simple to
> add if the demand is strong.
> 
>> Are validation functions in trunk or a released version?... or still
>> on the drawing board? (I suppose I should switch to the dev list to
>> ask that question to a more targeted audience.) :-)
>>
> 
> I wrote up my dive through the security_validation tests here:
> 
> http://jchris.mfdz.com/code/2008/12/couchdb_edge__security_and_vali
> 
> Validations are in trunk, but you'd have to do some work to use them
> in an application.
> 
> 

Mime
View raw message