Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
// Copyright IBM Corp. 2013,2018. All Rights Reserved.
// Node module: loopback-connector-oracle
// This file is licensed under the MIT License.
// License text available at https://opensource.org/licenses/MIT
'use strict';
const g = require('strong-globalize')();
const DataSource = require('loopback-datasource-juggler').DataSource;
const config = require('rc')('loopback', {dev: {oracle: {}}}).dev.oracle;
const ds = new DataSource(require('../'), config);
function show(err, models) {
if (err) {
console.error(err);
} else {
models.forEach(function(m) {
console.log(m);
});
}
}
/*
ds.discoverModelDefinitions({views: true, limit: 20}, show);
// Copyright IBM Corp. 2013. All Rights Reserved.
// Node module: loopback-connector-oracle
// US Government Users Restricted Rights - Use, duplication or disclosure
// restricted by GSA ADP Schedule Contract with IBM Corp.
'use strict';
var DataSource = require('loopback-datasource-juggler').DataSource;
var config = require('rc')('loopback', {dev: {oracle: {}}}).dev.oracle;
var ds = new DataSource(require('../'), config);
var results = ds.connector.querySync('SELECT * from PRODUCT');
console.log(results);
results = ds.discoverModelDefinitionsSync({views: true, limit: 20});
console.log(results);
results = ds.discoverModelPropertiesSync('PRODUCT');
console.log(results);
results = ds.discoverModelPropertiesSync('INVENTORY_VIEW',
{owner: 'STRONGLOOP'});
console.log(results);
// Copyright IBM Corp. 2013,2016. All Rights Reserved.
// Node module: loopback-connector-mysql
// This file is licensed under the MIT License.
// License text available at https://opensource.org/licenses/MIT
'use strict';
var DataSource = require('loopback-datasource-juggler').DataSource;
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);
});
}
}
}
// Copyright IBM Corp. 2013,2019. All Rights Reserved.
// Node module: loopback-connector-mongodb
// This file is licensed under the MIT License.
// License text available at https://opensource.org/licenses/MIT
'use strict';
const g = require('strong-globalize')();
const DataSource = require('loopback-datasource-juggler').DataSource;
const config = require('rc')('loopback', {dev: {mongodb: {}}}).dev.mongodb;
const ds = new DataSource(require('../'), config);
const Customer = ds.createModel('customer', {
seq: {type: Number, id: true},
name: String,
emails: [{label: String, email: String}],
age: Number,
});
Customer.destroyAll(function(err) {
Customer.create(
{
seq: 1,
name: 'John1',
emails: [