NOTE
StrongLoop Arc is no longer under active development, and will soon be deprecated. Arc's features are being included in the IBM API Connect Developer Toolkit: Please use it instead.
Skip to end of metadata
Go to start of metadata

Prerequisites

Icon
  1. Install StrongLoop.
  2. Follow instructions in Using Arc:
    1. If you don't already have an app, create a LoopBack app with slc loopback.
    2. In the project root directory, start Arc and login: slc arc.

 Contents

Data sources contain the actual data behind models and provide a way to persist the data.  Models attached to persistent data sources get additional methods for create, read, update, and delete (CRUD) operations.  For more information, see Connecting models to data sources.

Install the data source connector

By default, LoopBack models use the built-in memory connector for development and testing.  LoopBack applications created with slc loopback include the memory data source and connector.  The memory connector's data persists only while your LoopBack application is running: all data is lost when the LoopBack application is stopped.  The In-memory data source is named "db" by default and is shown in the navigation pane under the Data Sources folder.  

Icon

To create a data source that connects to a database, you must first install the connector with npm.

For example:

See Connecting models to data sources for a complete list of connector modules.

Creating a new data source

Before creating a new data source you must install the corresponding connector as described above.

To create a new data source:

  • Click + Add New Data source in the navigation pane.
  • Click  for the desired database type under DATASOURCE in the toolbox palette.
Icon

You can also create a new data source with slc loopback:datasource. For more information, see Connecting models to data sources.

Editing a data source

To edit an existing data source, simply click on it in the Data sources folder of the navigation pane.  The data source editor opens.  

You can edit several data sources at the same time, since each opens in a separate tab.

To delete a datasource, click  then choose delete.  This deletes the data source entry in /server/datasources.json, but does not delete any JavaScript files.

 

When you create a new data source or edit an existing data source as described above, you'll see the data source editor. 

The data source editor has three main sections:

Data source name

Credentials for authenticating with the data source.

Data source properties

Host - host name or IP address of the database server.

Port - TCP port database server is using.

Database - sometimes referred to as a "schema" grouping of tables or documents. If not specified, the data source will use all databases or schemas to which user has access.

Connector - the LoopBack connector to use.

Click Test Connection to verify that you can access a data source using the specified credentials and host information.

Model discovery

For data sources connected to relational databases, Composer can automatically create models from the database tables using LoopBack's discovery feature: In the navigation pane, click  to the right of the data source name and choose discover models.

See Discovering models from a database for more information.

  • No labels