I am creating an API through loopback and using visual database design tool MySQLworkbench.
While I'm creating models in loopback I confused to define keys(primary, foreign and candidate). When I go through loopback documentation it's said to use idInjection
. But, I confused how to use it.
Please, anyone, give me guidance to solve this issue
I'm afraid Loopback accept only "id" as primary key and it's mandatory to build loopback model relations.
The foreign key constraints or indexes setup in your database are not handeled by Loopback.
This job would belong to loopback-connector but it's not a part of the specifications.
The main advantages of working with loopback model relations is that you can have relations between different datasources. For example, when your create a "model A belongs to model B" relations, the datasource of model A can be different than the one of model B ! (and each datasource can use a different connector).
Sorry for my english...
Hope it helps