amco / dolly

Not an ORM for CouchDB in rails.
8 stars 3 forks source link

Handle partitioned databases #184

Closed javierg closed 2 years ago

javierg commented 2 years ago

CouchDB 2/3 allows partition databases, using this will allow to have namespaces lookups as fast as main index lookups,

We added a new class method for a Dolly Document such as

class MyDocument < Dolly::Document
  partitioned!
end

This will change the pattern for _id to be namespace:ID instead of namespace/ID

It will also raise an exception if the DB is not partitioned, so for 1.x will always raise this exception. The exception will raise when the class is loaded, so depending on the env, can be on app start.

javierg commented 2 years ago

Just not sure this should go into 3.1 or 3.2

we just pushed to 3.1, I think we should wait a couple of more features before going to 3.2