loopbackio / loopbackio/loopback-connector-mysql

Remove unknown options to the mysql2 initalizer

Open
#517 3 comments 3 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

feature
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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.