geddy / model

Datastore-agnostic ORM in JavaScript
265 stars 55 forks source link

How to write a custom adapter #262

Open ernestlessenger opened 9 years ago

ernestlessenger commented 9 years ago

I have written a custom Couchbase adapter, and would like to use it instead of one of the built-in adapters. How can I configure the new adapter as the default Adapter for model?

mde commented 9 years ago

This is awesome. Could you submit this with a PR, so we can bundle this adapter with all the others? (We would need it passing all the shared adapter tests of course.)

Use setDefaultAdapter for this: https://github.com/geddy/model/blob/master/lib/index.js#L910