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

feat(datasource): set named datasource with settings option #1554

Closed
wants to merge 1 commit into from

Conversation

truongminh
Copy link
Contributor

This pull request attempts to set an the appropriate name for the datasource.
In the existing code, this.name refers to the connector name.
In this PR, that name is changed to this.connectorName, while keeping the DataSource's methods unchanged to the outside.
That .name is now settings.name || connector.name and is used to find the datasource within an application context.
Related comments can be found here:
loopbackio/loopback-next#966 (comment)
@bajtos do you have any suggestion on this?

@slnode
Copy link

slnode commented Feb 7, 2018

Can one of the admins verify this patch? To accept patch and trigger a build add comment ".ok\W+to\W+test."

@@ -335,14 +335,14 @@ DataSource.prototype.connect = function(callback) {
* @returns {*}
* @private
*/
DataSource.prototype.setup = function(name, settings) {
DataSource.prototype.setup = function(connectorName, settings) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The name argument is the name of the dataSource. It should be changed to dsName to make it obvious.

Copy link
Contributor

@raymondfeng raymondfeng left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please change connectorName to dsName

@raymondfeng
Copy link
Contributor

Close it to favor #1555

@raymondfeng raymondfeng closed this Feb 8, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants