Update docs

This commit is contained in:
Raymond Feng 2013-08-22 12:20:07 -07:00
parent e82dc7a15a
commit 21d427e6d1
2 changed files with 4 additions and 2 deletions

View File

@ -105,10 +105,10 @@ For example,
var oracleConnector = require('loopback-connector-oracle'); var oracleConnector = require('loopback-connector-oracle');
var ds = new DataSource(oracleConnector, { var ds = new DataSource(oracleConnector, {
host : '166.78.158.45', host : '127.0.0.1',
database : 'XE', database : 'XE',
username : 'strongloop', username : 'strongloop',
password : 'str0ng100pjs', password : 'password',
debug : true debug : true
}); });

View File

@ -98,6 +98,7 @@ when dataSource emit 'connected' event.
To disconnect from database server call `dataSource.disconnect` method. This call To disconnect from database server call `dataSource.disconnect` method. This call
forwarded to connector if connector have ability to connect/disconnect. forwarded to connector if connector have ability to connect/disconnect.
### Discovering model definitions from the database
### Synchronizing model definitions and database tables ### Synchronizing model definitions and database tables
@ -114,6 +115,7 @@ and a `callback` argument, which receive boolean value depending on db state:
- false if db structure outdated - false if db structure outdated
- true when dataSource and db is in sync - true when dataSource and db is in sync
dataSource.isActual(models, function(err, actual) { dataSource.isActual(models, function(err, actual) {
if (!actual) { if (!actual) {
dataSource.autoupdate(models, function(err, result) { dataSource.autoupdate(models, function(err, result) {