lib/adapters/composite.js
function initialize(config, callback, config_helper) {
  config_helper = config_helper || require('../config/index');

  if(!checkConfSanity(config)) {
    callback(new Error('conf.dbopt is not sane, can\'t initialize composite adapter'));
    return;
  }

  populateDatabasesArray(config, config_helper, function(err, databases) {
    if(err)
      return callback(err);
    var adapter = new Compositeadapter(config, databases);
    callback(null, adapter);
  });
}
function initialize(config, callback, config_helper) {
  config_helper = config_helper || require('../config/index');

  if(!checkConfSanity(config)) {
    callback(new Error('conf.dbopt is not sane, can\'t initialize composite adapter'));
    return;
  }

  populateDatabasesArray(config, config_helper, function(err, databases) {
    if(err)
      return callback(err);
    var adapter = new Compositeadapter(config, databases);
    callback(null, adapter);
  });
}
function initialize ( config , callback , config_helper ) { config_helper = config_helper || require ( '../config/index' ) ; if ( ! checkConfSanity ( config ) ) { callback ( new Error ( 'conf.dbopt is not sane, can\'t initialize composite adapter' ) ) ; return ; } populateDatabasesArray ( config , config_helper , function ( err , databases ) { if ( err ) return callback ( err ) ; var adapter = new Compositeadapter ( config , databases ) ; callback ( null , adapter ) ; } ) ; }
A composite adapter that consists of multiple adapters.
The adapters may be of a different type.

`config.dbopt` should be an array containing JSON-objects
that will be used to initialize the individual adapters. This function
uses config/index.js's initializeDb-function to initialize the adapters.

@param {Object} config - Configuration object as passed from config.js
@param {Function} callback
@param {Object} config_helper - A helper to use for initializing adapters (for testing)
A composite adapter that consists of multiple adapters . The adapters may be of a different type .