2013-06-08 00:37:30 +00:00
|
|
|
/**
|
|
|
|
* Expose `Connector`.
|
|
|
|
*/
|
|
|
|
|
|
|
|
module.exports = Connector;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Module dependencies.
|
|
|
|
*/
|
|
|
|
|
|
|
|
var EventEmitter = require('events').EventEmitter
|
|
|
|
, debug = require('debug')('connector')
|
|
|
|
, util = require('util')
|
|
|
|
, inherits = util.inherits
|
|
|
|
, assert = require('assert');
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Create a new `Connector` with the given `options`.
|
|
|
|
*
|
|
|
|
* @param {Object} options
|
|
|
|
* @return {Connector}
|
|
|
|
*/
|
|
|
|
|
|
|
|
function Connector(options) {
|
|
|
|
EventEmitter.apply(this, arguments);
|
|
|
|
this.options = options;
|
|
|
|
|
|
|
|
debug('created with options', options);
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Inherit from `EventEmitter`.
|
|
|
|
*/
|
|
|
|
|
|
|
|
inherits(Connector, EventEmitter);
|
|
|
|
|
|
|
|
/*!
|
2013-07-23 19:58:03 +00:00
|
|
|
* Create an connector instance from a JugglingDB adapter.
|
2013-06-08 00:37:30 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
Connector._createJDBAdapter = function (jdbModule) {
|
|
|
|
var fauxSchema = {};
|
|
|
|
jdbModule.initialize(fauxSchema, function () {
|
|
|
|
// connected
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
/*!
|
|
|
|
* Add default crud operations from a JugglingDB adapter.
|
|
|
|
*/
|
|
|
|
|
2013-07-23 19:58:03 +00:00
|
|
|
Connector.prototype._addCrudOperationsFromJDBAdapter = function (connector) {
|
2013-06-08 00:37:30 +00:00
|
|
|
|
|
|
|
}
|