Page Contents

Synopsis

Adds a new data source definition to a LoopBack application.

$ lb datasource [options] [<name>]

Adds a new model to a LoopBack application.

apic create --type datasource [options] [<name>]

With legacy StrongLoop tools:

$ slc loopback:datasource [options] [<name>]

Options

-h, --help Print the generator’s options and usage.

--skip-cache Do not remember prompt answers. Default is false.

--skip-install Do not automatically install dependencies. Default is false.

Arguments

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.

Interactive Prompts

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.

You must install the connector for the new data source; for example: npm install --save loopback-connector-mysql

Output

This adds an entry to datasources.json with the specified settings.