Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add --tables/--models arguments to lb4 discover command #7104

Closed
rigibore-charlie opened this issue Feb 10, 2021 · 6 comments · May be fixed by #8419
Closed

Add --tables/--models arguments to lb4 discover command #7104

rigibore-charlie opened this issue Feb 10, 2021 · 6 comments · May be fixed by #8419

Comments

@rigibore-charlie
Copy link

Suggestion

Add arguments --tables or --models to lb4 discover command.

Use Cases

I'm a new user to Loopback trying to create a REST API for two large existing SQL Server databases, each database has in excess of 200 tables spanning 8+ schemas, and scrolling the list in the interactive prompts to find just the 8 tables required is near impossible, and made worse by the fact that the results don't seem to be in any particular order...?

image

This would also allow you to selectively discover models later in development much easier.

Examples

lb4 discover --tables=customers,contacts,quotes,parts
lb4 discover --models=customers,contacts,quotes,parts

@achrinza
Copy link
Member

achrinza commented Feb 18, 2021

@dhmlau I don't permissions to shift this issue to the LoopBack 4 repo. Could you please assist? Thanks

@dhmlau dhmlau transferred this issue from strongloop/loopback Feb 18, 2021
@dhmlau
Copy link
Member

dhmlau commented Feb 18, 2021

Transferred!

@dhmlau
Copy link
Member

dhmlau commented Feb 18, 2021

It would be a useful feature. For database migration, we can list which models to migrate, but not for discovery.

@igbenic
Copy link

igbenic commented Jul 8, 2021

Any other way of doing this in the meantime? I have 2500 tables, impossible to navigate with CLI.

Made a PR: #7609

@prespic
Copy link

prespic commented Nov 10, 2021

WORKAROUND:

lb4 discover --all --outDir=src/models/all

Generates all models. Then you can easily pick the right ones and remove the others.

punitdiwan added a commit to punitdiwan/loopback-next that referenced this issue Mar 23, 2022
added --models option inside lb4 discover command to generate specific
models

BREAKING CHANGE: 🧨 no

✅ Closes: loopbackio#7104

Signed-off-by: Punit Diwan <[email protected]>
@achrinza achrinza moved this from Icebox to Current/Backlog in LoopBack Common Project Board May 10, 2022
@aaqilniz
Copy link
Contributor

aaqilniz commented May 18, 2023

lb4 discover --model is available now. Have a look at the PR. Closing the issue.

@github-project-automation github-project-automation bot moved this from Current/Backlog to Done in LoopBack Common Project Board May 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment