Skip to content

Commit

Permalink
Reformat code
Browse files Browse the repository at this point in the history
  • Loading branch information
Raymond Feng committed Feb 13, 2014
1 parent 5967659 commit e54aa56
Show file tree
Hide file tree
Showing 11 changed files with 1,880 additions and 1,897 deletions.
12 changes: 9 additions & 3 deletions docs.json
@@ -1,8 +1,14 @@
{
"content": [
{"title": "LoopBack MySQL Connector API", "depth": 2},
"content": [
{
"title": "LoopBack MySQL Connector API",
"depth": 2
},
"lib/mysql.js",
{"title": "MySQL Discovery API", "depth": 2},
{
"title": "MySQL Discovery API",
"depth": 2
},
"lib/discovery.js"
],
"codeSectionDepth": 3
Expand Down
30 changes: 14 additions & 16 deletions example/app.js
Expand Up @@ -5,36 +5,34 @@ var config = require('rc')('loopback', {dev: {mysql: {}}}).dev.mysql;
var ds = new DataSource(require('../'), config);

function show(err, models) {
if (err) {
console.error(err);
} else {
console.log(models);
if (models) {
models.forEach(function (m) {
console.dir(m);
});
}
if (err) {
console.error(err);
} else {
console.log(models);
if (models) {
models.forEach(function (m) {
console.dir(m);
});
}
}
}


ds.discoverModelDefinitions({views: true, limit: 20}, show);

ds.discoverModelProperties('customer', show);

ds.discoverModelProperties('location', {owner: 'strongloop'}, show);

ds.discoverPrimaryKeys('customer', show);
ds.discoverForeignKeys('inventory', show);

ds.discoverExportedForeignKeys('location', show);
ds.discoverForeignKeys('inventory', show);

ds.discoverExportedForeignKeys('location', show);

ds.discoverAndBuildModels('weapon', {owner: 'strongloop', visited: {}, associations: true}, function (err, models) {

for (var m in models) {
models[m].all(show);
}
for (var m in models) {
models[m].all(show);
}

});

Expand Down

0 comments on commit e54aa56

Please sign in to comment.