Creating APIs‎ > ‎Database Creation‎ > ‎

Manage Existing Schema

With managed data, you can add tables, fields, and relationships using Data Explorer. You can create a new managed database within a managed data server, or if you want to control schema creation (its name, location, etc.), create a new database and use managed data within your own schema.

The following procedures apply to creating a new database and using managed data within your own schema. To create a new managed database within a managed data server, see Database Creation.

Existing Schema

Mark that you can alter any schema of any supported server in your API.

Mark your Schema as Editable

    1. With your API open, go to the Integrate, Data Sources, Connection tab and mark the data source as editable by selecting the Schema is editable checkbox.
      The following image shows the checkbox on this tab:
    2. Save your changes.
Your can change this schema of any supported server in your API.

Manage your Tables

Prerequisites: The schema is editable.

You can do the following to manage your tables:
  • Add a new table to an editable data source.

Best Practice: If you are using multiple databases, prefix your table name with the database name (for example main:Customer).

  • Update a table name to an editable data source.
  • Delete an existing table.

Manage your Columns

Prerequisites: The selected table is an editable schema.

You can do the following to manage your columns:
  • Add a new column on a table.
  • Update a column name.
  • Delete an existing column.

Create a Derby Schema

Live API Creator includes Apache Derby, so it is great for experimenting. Managed data is an easy path to creating databases and APIs. You may wish to share an API with colleagues. If you use a managed data server, API Creator creates the schema under an install folder with a name like "Managed Databases". This makes it hard to extract a particular schema and send to colleagues. You can control (and isolate) the database location and then use managed data without a managed data server.

Create your API

For more information about creating new APIs and the connection wizard, see Create your API Project.

    1. On the Home page, click Create New API. (If the Welcome Window is displayed, close this window.)
      The connection wizard opens.
    2. Select Derby/JavaDB as the target database.
      The connection parameters for the new Derby database display in the wizard. The following image shows the Derby connection parameters in the wizard:
    3. Complete the following:
      1. In the URL field, enter the desired folder location. For example:
        jdbc:derby:directory:/Users/val/lac/api-projects/Market/MarketDB;create=true
      2. Complete the remaining fields.
      3. Click Continue.

The API is created. A new Derby schema is created.

Mark your Schema as Editable

Designate that you can alter any schema of any supported server in your API.
    1. Open the API and go to the Integrate, Data Sources, Connection tab and mark the data source as editable by selecting the Schema is editable checkbox.
    2. Designate that any schema of any supported server can be altered by selecting the Schema is editable checkbox.
      The following image shows the checkbox on this tab:
    3. Save your changes.

Create your Database

  1. With your API open, start Data Explorer in a new tab and access Author Mode.
  2. Add tables, fields, and relationships to your managed data source.
Your database is created.

Share your API

You can share your API with colleagues. They can import the API you send them and fix the data source location to their folder definition.

The following technique was used to prepare the Marketing Sample.

  1. Export the API definition (for example, Market.json).
  2. Place the file in a folder that also contains the database (MarketDB). The following image shows the folder structure:

  3. Zip and send to your colleague (Market.zip).

Load a shared Derby API

You can relocate the data source for a Derby database.

On the Integrate, Data Sources, Connection tab, complete the page as illustrated in the following image: