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

[CLI] Use a custom Repository base class #2149

Closed
bajtos opened this issue Dec 13, 2018 · 3 comments · Fixed by #2317
Closed

[CLI] Use a custom Repository base class #2149

bajtos opened this issue Dec 13, 2018 · 3 comments · Fixed by #2317
Assignees

Comments

@bajtos
Copy link
Member

bajtos commented Dec 13, 2018

Application developers invoking lb4 repository should be able to specify a custom Repository class to inherit from. This repository can be defined in a 3rd-party extension or inside the application project.

At minimum, the CLI should accept custom class name (+ import path?):

  • via an interactive prompt
  • via CLI options
  • via JSON config

Even better, there should be a mechanism allowing extensions (npm packages) and applications to define custom Repository implementations in such way that lb4 repository can pick them and create a list of available repositories for the CLI user to pick from.

See also #2095 (comment)

@gczobel-f5
Copy link
Contributor

@bajtos Hi, I started to work on this issue and I'm preparing a PR.
I have a question that raised looking on the tests.
Looks that there is an assumption that providing --datasource parameter, is enough to infer the Base repository. So a KV db used DefaultKeyValueRepository.

What will be the expected result when the DS type does not match with the base repository provided as an argument? Remember that at this moment we are looking only to filenames and not the file contents.

@dhmlau
Copy link
Member

dhmlau commented Jan 11, 2019

@gczobel-f5 , saw your PR https://github.com/strongloop/loopback-next/pulls, so I'm assigning this task to you. Thanks.

@dhmlau
Copy link
Member

dhmlau commented Jan 24, 2019

PR #2235

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants