Let Users Provide a UuidFactory
Reported by Seth Ladd | October 23rd, 2008 @ 05:02 PM
Hello,
Another option is to let a user pass in a UuidFactory, responsible for generating and caching UUIDs. This way, if your server doesn't support /_uuids (as is the case with 0.8.1) or you want to provide your own algorithm, it's a simple interface to implement.
Would expect you could do something like:
CouchDb.uuid_factory = MyOwnUuidFactory.new
and the default implementation is the existing CouchDbUuidFactory.
It nicely centralizes the UUID generation and makes it pluggable.
Thanks, Seth
No comments found
Create your profile
Help contribute to this project by taking a few moments to create your personal profile. Create your profile ยป
"CouchDB, close to the metal." <a href="http://github.com/jchris/couchrest/tree/master">CouchRest</a> is a RESTful layer for accessing CouchDB, based off CouchDB's included Javascript reference client. CouchRest also includes helpers for running large queries etc. There is also a base class for ActiveRecord / Datamapper style ORM, called CouchRest::Model.
People watching this ticket
- Nobody is watching this ticket.