loopback-datasource-juggler/test/mock-connectors.js

33 lines
859 B
JavaScript
Raw Normal View History

2016-04-01 22:25:16 +00:00
// Copyright IBM Corp. 2016. All Rights Reserved.
// Node module: loopback-datasource-juggler
// This file is licensed under the MIT License.
// License text available at https://opensource.org/licenses/MIT
2016-08-22 19:55:22 +00:00
'use strict';
module.exports = {
// connector which uses custom field settings
customFieldSettings: {
initialize: function(ds, done) {
ds.connector = {
name: 'custom',
discoverModelProperties: function(resource, options, done) {
done(null, [
{
owner: 'public',
columnName: 'name',
type: 'String',
required: false,
// custom properties listed under a key matching the connector name
2016-08-19 17:46:59 +00:00
custom: {storage: 'quantum'},
2016-04-01 11:48:17 +00:00
},
]);
2016-04-01 11:48:17 +00:00
},
};
ds.connector.dataSource = ds;
2016-04-01 11:48:17 +00:00
},
},
};