Northwind API Project Sample

The Northwind API sample illustrates the connect process and the resulting API and UI that are created through schema discovery. You might find it helpful to use this sample when you first use Live API Creator.

For more information about creating a new API and connecting to the example Northwind database, see Create your API Project and Database Connectivity.

This sample includes a set of rules, resources, and security settings you can explore. The following diagram illustrates the rules:

The Northwind business rules illustrate:
  • The "cocktail napkin" design.
  • The logic dependencies. 
  • The use cases that the rules solve.

Schema

Northwind has the following schema:

Predefined Rules

You can explore the predefined rules on the Manage, Rules, By table tab. The following image shows the rules on this tab:

While you might have conceived the rules for Place Order/Check Credit, they operate on any RESTful update against the data. You can alter an orderdetails.Quantity and the logic does the following:

  1. Recomputes the orderdetails.Amount, since it is dependent on the quantity.
  2. Adjusts the orders.AmountTotal with a one-row SQL update (not a select sum), since it is dependent on the amount.
  3. Adjusts the customers.balance.
  4. Verifies this does not exceed the credit limit (else an exception is thrown and the transaction is rolled back).

In the same manner, API Creator automatically reuses this logic over all related transactions. This automatic change detection, propagation, SQL, and transaction management results in meaningful reductions in boilerplate code.

For more information about how the rules process an update request, see Reactive Logic Operation.

Example

The following example illustrates Data Explorer running on Northwind.

  1. Start Data Explorer. The following image shows Data Explorer:
  2. Drill down to the product Chai. The following image shows the product Chai in the Form:

The Order Details tab in the Child Grid shows the orders for the Chai product. API Creator has joined in the Ship Name from the orderdetails using predictive joins.