loopback-discovery
v1.0.6
Published
Database model discovery script for LoopBack
Readme
##loopback-discovery
loopback-discovery is a command prompt discovery script for the
[LoopBack] (https://github.com/strongloop/loopback/) framework.
##Installation
npm install -g loopback-discovery##Basic use
The script can discover models from data sources defined on a StrongLoop application from command line. This is mainly for overcoming missing support for 'non-supported' connectors in StrongLoop's [Arc] (https://github.com/strongloop/strong-arc) GUI interface.
- To run model discovery for
sportsdata source inside a StrongLoop application available in current folder.
$ loopback-discoveryWith this new models from sports data source will be discovered, the one that already exists are being skipped. Once discovered the user gets to select the ones that are going to be publicly exposed through the REST interface.
- To run model discovery for
sportsdata source inside a StrongLoop application available in/opt/strongloop/sports.
$ loopback-discovery -d sports /opt/strongloop/sports- To run model discovery for
sportsdata source inside a StrongLoop application available in/opt/strongloop/sportswhile overwriting existing model definition.
$ loopback-discovery -o -d sports /opt/strongloop/sports- By default the schema used in connection connection definition is used for discovery, however some
loopback connectors can support additional discovery options:
all: to use all owners/schemas for discovery use-acommand optionviews: to include views in discovery use-vcommand option
$ loopback-discovery -a -v -d sports /opt/strongloop/sportsFor information on configuring the connector in a LoopBack application, please refer to LoopBack documentation.
##Tests:
To run the test suite set-up the test StrongLoop application in test folder:
$ cd test/slc-app
$ npm installUpdate sports data source configuration in test/slc-app/server/data-sources.json
to a connection locally available.
"sports": {
"host": "10.10.10.6",
"port": 37900,
"database": "sports2000",
"name": "sports",
"connector": "loopback-connector-akera"
}Run the test scripts.
$ npm test