Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
export function MongoDBAdapter (opts) {
utils.classCallCheck(this, MongoDBAdapter)
opts || (opts = {})
if (utils.isString(opts)) {
opts = { uri: opts }
}
utils.fillIn(opts, DEFAULTS)
// Setup non-enumerable properties
Object.defineProperties(this, {
/**
* A Promise that resolves to a reference to the MongoDB client being used by
* this adapter.
*
* @name MongoDBAdapter#client
* @type {Promise}
*/
client: {
export function RethinkDBAdapter (opts) {
utils.classCallCheck(this, RethinkDBAdapter)
opts || (opts = {})
// Setup non-enumerable properties
Object.defineProperties(this, {
/**
* The rethinkdbdash instance used by this adapter. Use this directly when
* you need to write custom queries.
*
* @example Use default instance.
* import { RethinkDBAdapter } from 'js-data-rethinkdb';
* const adapter = new RethinkDBAdapter();
* adapter.r.dbDrop('foo').then(...);
*
* @example Configure default instance.
* import { RethinkDBAdapter } from 'js-data-rethinkdb';
* const adapter = new RethinkDBAdapter({
export function HttpAdapter (opts) {
utils.classCallCheck(this, HttpAdapter)
opts || (opts = {})
// Fill in any missing options with the defaults
utils.fillIn(opts, DEFAULTS)
Adapter.call(this, opts)
}
export function CloudDatastoreAdapter (opts) {
utils.classCallCheck(this, CloudDatastoreAdapter);
opts || (opts = {});
// Setup non-enumerable properties
Object.defineProperties(this, {
/**
* Instance of Datastore used by this adapter. Use this directly when
* you need to write custom queries.
*
* @name CloudDatastoreAdapter#datastore
* @type {object}
*/
datastore: {
writable: true,
value: undefined
}
});
export function SqlAdapter (opts) {
utils.classCallCheck(this, SqlAdapter)
opts || (opts = {})
opts.knexOpts || (opts.knexOpts = {})
utils.fillIn(opts, DEFAULTS)
Object.defineProperty(this, 'knex', {
writable: true,
value: undefined
})
Adapter.call(this, opts)
/**
* Override the default predicate functions for specified operators.
*
* @name SqlAdapter#operators
* @type {Object}
export function FirebaseAdapter (opts) {
utils.classCallCheck(this, FirebaseAdapter)
opts || (opts = {})
Adapter.call(this, opts)
/**
* The database instance used by this adapter.
*
* @name FirebaseAdapter#db
* @type {Object}
* @default firebase.database()
*/
if (opts.db) {
this.db = opts.db || firebase.database()
/**
* The base ref to use as a root, e.g. `user/uid`
*
* @name FirebaseAdapter#baseRef