Rename adapters to connectors

This commit is contained in:
Raymond Feng 2013-07-23 14:40:44 -07:00
parent ac76666b7b
commit 752aedb80d
8 changed files with 9 additions and 9 deletions

View File

@ -15,13 +15,13 @@ require('./relations.js');
var Inclusion = require('./include.js'); var Inclusion = require('./include.js');
var Relation = require('./relations.js'); var Relation = require('./relations.js');
var geo = require('./geo'); var geo = require('./geo');
var Memory = require('./adapters/memory').Memory; var Memory = require('./connectors/memory').Memory;
var fieldsToArray = require('./utils').fieldsToArray; var fieldsToArray = require('./utils').fieldsToArray;
/** /**
* DAO class - base class for all persist objects * DAO class - base class for all persist objects
* provides **common API** to access any database connector. * provides **common API** to access any database connector.
* This class describes only abstract behavior layer, refer to `lib/adapters/*.js` * This class describes only abstract behavior layer, refer to `lib/connectors/*.js`
* to learn more about specific connector implementations * to learn more about specific connector implementations
* *
* `DataAccessObject` mixes `Inclusion` classes methods * `DataAccessObject` mixes `Inclusion` classes methods

View File

@ -184,9 +184,9 @@ DataSource.prototype.setup = function(name, settings) {
} else if (name.match(/^\//)) { } else if (name.match(/^\//)) {
// try absolute path // try absolute path
connector = require(name); connector = require(name);
} else if (existsSync(__dirname + '/adapters/' + name + '.js')) { } else if (existsSync(__dirname + '/connectors/' + name + '.js')) {
// try built-in connector // try built-in connector
connector = require('./adapters/' + name); connector = require('./connectors/' + name);
} else { } else {
// try foreign connector // try foreign connector
try { try {
@ -402,7 +402,7 @@ DataSource.prototype.defineProperty = function (model, prop, params) {
/** /**
* Drop each model table and re-create. * Drop each model table and re-create.
* This method make sense only for sql adapters. * This method make sense only for sql connectors.
* *
* @warning All data will be lost! Use autoupdate if you need your data. * @warning All data will be lost! Use autoupdate if you need your data.
*/ */
@ -417,7 +417,7 @@ DataSource.prototype.automigrate = function (cb) {
/** /**
* Update existing database tables. * Update existing database tables.
* This method make sense only for sql adapters. * This method make sense only for sql connectors.
*/ */
DataSource.prototype.autoupdate = function (cb) { DataSource.prototype.autoupdate = function (cb) {
this.freeze(); this.freeze();
@ -960,7 +960,7 @@ DataSource.prototype.discoverAndBuildModelsSync = function (modelName, options)
/** /**
* Check whether migrations needed * Check whether migrations needed
* This method make sense only for sql adapters. * This method make sense only for sql connectors.
*/ */
DataSource.prototype.isActual = function (cb) { DataSource.prototype.isActual = function (cb) {
this.freeze(); this.freeze();
@ -975,7 +975,7 @@ DataSource.prototype.isActual = function (cb) {
* Log benchmarked message. Do not redefine this method, if you need to grab * Log benchmarked message. Do not redefine this method, if you need to grab
* chema logs, use `dataSource.on('log', ...)` emitter event * chema logs, use `dataSource.on('log', ...)` emitter event
* *
* @private used by adapters * @private used by connectors
*/ */
DataSource.prototype.log = function (sql, t) { DataSource.prototype.log = function (sql, t) {
this.emit('log', sql, t); this.emit('log', sql, t);

View File

@ -18,7 +18,7 @@ var BASE_TYPES = ['String', 'Boolean', 'Number', 'Date', 'Text'];
/** /**
* Model class - base class for all persist objects * Model class - base class for all persist objects
* provides **common API** to access any database connector. * provides **common API** to access any database connector.
* This class describes only abstract behavior layer, refer to `lib/adapters/*.js` * This class describes only abstract behavior layer, refer to `lib/connectors/*.js`
* to learn more about specific connector implementations * to learn more about specific connector implementations
* *
* `ModelBaseClass` mixes `Validatable` and `Hookable` classes methods * `ModelBaseClass` mixes `Validatable` and `Hookable` classes methods