digs-data v0.1.4
digs-data
Database interface for digs
Overview
As of this writing, this is a digs plugin (Hapi plugin) providing a wrapper around Thinky, an ORM-type-thing for RethinkDB. It serves as a central connection pool to RethinkDB, and exposes some functionality to the Server
object for other plugins to use. If you need to define models and persist data in a digs server, use this package.
I'd like to provide a simple, pure-JavaScript JSON-based datastore as the default instead, but I'm not sure which to use (any ideas? Let me know!). Because of the reliance on RethinkDB, digs won't run without it, which is something I'd like to avoid.
API
Currently, this plugin decorates the Server
object with two methods:
model()
An alias for thinky.createModel()
. The returned model function is not a constructor like in Thinky, but rather a "stamp". It can be used with or without the new
keyword.
types()
Returns a reference to thinky.types
.
Author
License
MIT