loopbackio / loopbackio/loopback-connector-mysql
Remove unknown options to the mysql2 initalizer
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 126
- Forks
- 181
- Avg merge
- 4d 7h
- Merged PRs (30d)
- 12
Description
## 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](https://github.com/sidorares/node-mysql2/blob/a1fd971eb76db3b3820fde5b80257d565888b258/lib/connection_config.js#L89) warning
```js
if (validOptions[key] !== 1) {
// REVIEW: Should this be emitted somehow?
// eslint-disable-next-line no-console
console.error(
`Ignoring invalid configuration option passed to Connection: ${key}. 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`
);
}
```
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)
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by tracing the Mysql2 initializer and checking how DataSource options reach the mysql2 connection_config.js validation linked in the issue. Confirm which options are supported and establish tests for the filtering behavior; done means unsupported options no longer trigger the warning while supported connection options continue to work.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, mysql, nodejs
- Domain
- database
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100