Important: Before running this generator, you must create an application using the application generator. Then you must run the command from the root directory of the application.
Adds a new data source definition to a LoopBack application.
lb datasource [options] [<name>]
With IBM API Connect v5 developer toolkit:
apic create --type datasource [options] --name [<name>]
With legacy StrongLoop tools:
slc loopback:datasource [options] [<name>]
- Fetch provisioned data source services from IBM Cloud and present them in the list of choices for data source to add. Currently lists only Cloudant, MongoDB, and IBM Object Storage services. You will be prompted to log in if you are not already authenticated.
- With IBM API Connect v5 developer toolkit only, optionally provide the name of the data source as the value of this option. If provided, the tool will use that as the default when it prompts for the name.
- Print the generator’s options and usage.
- Do not remember prompt answers. Default is false.
- Do not automatically install dependencies. Default is false.
You can optionally provide the name of the data source to create as an argument. If you do, the tool will use that as the default when it prompts for the name.
The tool will prompt you for:
- Name of the new data source. If you supplied a name on the command-line, just hit Enter to use it.
- Connector to use for the data source.
If you run the generator with the
--bluemixoption, you will be presented with a list of provisioned data services from IBM Cloud.
You must install the connector for the new data source; for example:
npm install --save loopback-connector-mysql
This adds an entry to
datasources.json with the specified settings.
If you selected a IBM Cloud data source, it will be entered in the