feat: implement DataSource.stop()#1835
Conversation
|
@slnode test please |
|
Adding a |
emonddr
left a comment
There was a problem hiding this comment.
Approved, but please fix that typo before landing PR.
Implement `stop` as an alias for `disconnect`. This way LB4 applications don't have to include custom `stop` implementation in every datasource file. Signed-off-by: Miroslav Bajtoš <mbajtoss@gmail.com>
2a3b83f to
c83f82d
Compare
The constructor of DataSource and/or the connector is dealing with establishing the connection, it also depends on whether the connector provides To my best knowledge, LB4 is delegating the logic of establishing the connection fully to loopback-datasource-juggler and the connectors. My pull request preserves that behavior by NOT introducing |
|
@slnode test please |
|
@slnode test please |
jannyHou
left a comment
There was a problem hiding this comment.
My pull request preserves that behavior by NOT introducing start method as an alias for connect. It may be possible to implement that in the future, but that's out of scope of this pull request.
thank you for the explanation! LGTM 🚢
|
Since this "stop" simple projects doesn't compile anymore See here a brand new project made with latest updates |
|
Thank you @danysz for reporting the issue. We are aware of the problem, see the discussion in loopbackio/loopback-next#5261 |
|
loopbackio/loopback-next#5261 (comment)
I was thinking about this a bit more and realized that we have to fix the typings because I don't see any other way how to avoid breaking existing LB4 applications. I opened a new PR in juggler, I would like to get it approved, merged and published today. See |
|
I published |
Implement
stopas an alias fordisconnect. This way LB4 applications don't have to include customstopimplementation in every datasource file.Intended datasource file:
Compare with the current template:
Please note this change still allows app developers to add custom logic to start/stop step:
Checklist
👉 Read and sign the CLA (Contributor License Agreement) 👈
npm testpasses on your machine