loopback-next icon indicating copy to clipboard operation
loopback-next copied to clipboard

Improve lb4 discover to discover relations

Open godartm opened this issue 7 years ago • 6 comments

Suggestion

Actually a models can be discovered from a supported datasource by running the lb4 discover command. But this didn't detect relation between table . But for me, the strong advantage of the discover option is to detect the relation beetween model and create the navigational property. If the datasource support this feature (For exemple: mysql),

Use Cases

This will allow us to save time when creating model for an existing database. For exemple if you want to migrate to loopback 4 with an existing database.

What shortcomings exist with current approaches?

Actually the model is create right but the navigational property is not created.

Examples

An exemple how the feature can be use is to run lb4 discover with a new extra argument or just add this feature by default.

Acceptance criteria

TBD - will be filled by the team.

godartm avatar Aug 01 '19 06:08 godartm

@bajtos, do you think it would be part of the strong relation epic?

dhmlau avatar Nov 23 '19 02:11 dhmlau

Any update on this?

morfie78 avatar Jan 09 '20 19:01 morfie78

Was able to add relation support. https://github.com/aspectgfg/loopback-next Only changes were to grab model defs with relations/foreignKeys, and then run the Relation Generator for each relation. It's not good enough for a PR though, do with it what you will.

reaperdtme avatar Jun 11 '20 16:06 reaperdtme

I believe this feature request is a vital one just like feature request #6002

mbnoimi avatar Nov 08 '20 06:11 mbnoimi

This issue has been marked stale because it has not seen activity within six months. If you believe this to be in error, please contact one of the code owners, listed in the CODEOWNERS file at the top-level of this repository. This issue will be closed within 30 days of being stale.

stale[bot] avatar Jul 14 '21 05:07 stale[bot]

This issue has been closed due to continued inactivity. Thank you for your understanding. If you believe this to be in error, please contact one of the code owners, listed in the CODEOWNERS file at the top-level of this repository.

stale[bot] avatar Aug 13 '21 06:08 stale[bot]