loopback icon indicating copy to clipboard operation
loopback copied to clipboard

Data mapping should happen by default during model discovery + generation

Open cgole opened this issue 10 years ago • 6 comments

Instead of having to manually edit the models to add the data mapping, can we have that automated? Seems like a useful feature to have.

cgole avatar Jul 07 '16 21:07 cgole

Looks like this is how discovery should work by default. Its a bug in discovery..We found it in mysql.. Not tried with other databases.

cgole avatar Jul 07 '16 21:07 cgole

The DB specific mappings should be there by default with discovery. See https://github.com/strongloop/loopback-connector-mysql/blob/master/test/mysql.discover.test.js#L211. Maybe the UI does not?

raymondfeng avatar Jul 07 '16 21:07 raymondfeng

+1

gxvigo avatar Jul 07 '16 22:07 gxvigo

The loopback-workspace api seems to handle extensions correctly too. See https://github.com/strongloop/loopback-workspace/blob/master/test/model-property.js#L72

raymondfeng avatar Jul 07 '16 23:07 raymondfeng

To have a more detailed context of this issue, here is the original buggy scenario:

when column names in mysql have underscore, and you discover and generate a model the underscore is gone and so the model names dont correspond exactly to the table names.

Related to issue: https://github.ibm.com/apimesh/scrum-api-editor/issues/814 Will verify is it fixed by issue above asap.

jannyHou avatar Oct 25 '16 03:10 jannyHou

AFAICT, this issue was fixed at the UI side.

bajtos avatar Nov 12 '19 16:11 bajtos