StrongLoop Composer's discovery feature enables you to quickly and easily create models from existing database tables. Follow these steps:
- Create a data source to connect to your database, providing your database server credentials, as described in Creating and editing data sources.
- Test the connection using the Test Connection button to ensure that you can connect to the database.
- In the navigation pane, click on the inverted triangle next to the data source and choose Discover models:
- Composer will list the tables in the database, as shown below (for example). Select the tables for which you want to create models, or click Select All to create models for all the tables shown, then click Next.
- Composer will list the columns in each table you selected, along with the relevant metadata. Deselect any columns for which you don't want to create properties, then click Next.
Composer will then create the selected models and properties corresponding to the database's tables and columns, and display them in the model editor; for example: