-
Notifications
You must be signed in to change notification settings - Fork 183
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
Remove unknown options to the mysql2 initalizer #517
Comments
I am having a similar issue after updating to 7.0.6 Ignoring invalid configuration option passed to Connection: name. This is currently a warning, but in future versions of MySQL2, an error will be thrown if you pass an invalid configuration option to a Connection Ignoring invalid configuration option passed to Connection: connector. This is currently a warning, but in future versions of MySQL2, an error will be thrown if you pass an invalid configuration option to a Connection Ignoring invalid configuration option passed to Connection: url. This is currently a warning, but in future versions of MySQL2, an error will be thrown if you pass an invalid configuration option to a Connection Ignoring invalid configuration option passed to Connection: disableMigration. This is currently a warning, but in future versions of MySQL2, an error will be thrown if you pass an invalid configuration option to a Connection Ignoring invalid configuration option passed to Connection: lazyConnect. This is currently a warning, but in future versions of MySQL2, an error will be thrown if you pass an invalid configuration option to a Connection Ignoring invalid configuration option passed to Connection: collation. This is currently a warning, but in future versions of MySQL2, an error will be thrown if you pass an invalid configuration option to a Connection Are these options not supported? What is the solution to avoid this ? The documentation still shows that we can use all these parameters |
I have the same issue. Additionally, for Loopback juggler.DataSource options, connector and name properties are needed in the options object, which also end up getting passed through to the code highlighted by @FanGoH (via the code added in #46).
Whilst it is desirable to pass through valid options (in my case it is how I pass ssl options), perhaps an answer is for mysql2 to export the list of valid options (probably have them in separate module in fact) and for the 'option passthrough' code above to only include valid options.... E.g. (assuming e.g. that validOptions is exported by mysql2.js in mysql2 module and imported in mysql.js).
Of course this would need the change (to export the valid options) to be made also in the mysql2 project, and we definitely do not want to duplicate the list of valid options in loopback-connector-mysql.... A disadvantage of the change is that it is possible that the mysql2 maintained list of valid options isn't up-to-date with the latest list of options accepted by MySQL/MariaDB - and in that case there is an argument to get rid of the logged error (flagged by @FanGoH ) entirely! |
I've also raised issue in mysql2 for this. |
Suggestion
Is there any drawback to stripping connection options from the DataSource to the Mysql2 underlying connector?, I would ideally like to remove the emission of this warning
If there isn't anything against it, I would love to contribute with a pull request, the only drawback I can think of is that the validOptions aren't exported from the library.
(Sorry for not following the template, I didn't felt that the formats properly addressed what I wanted to communicate)
The text was updated successfully, but these errors were encountered: