loopbackio / loopbackio/loopback-connector-mysql
Differentiating between database name & table_schema
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 126
- Forks
- 181
- Avg merge
- 4d 7h
- Merged PRs (30d)
- 12
Description
Hi.
While discovering models, if no schema is provided (and the `all` flag is false), the connector fetches the tables/models that belong to the logged-in user at MySQL DB. [Link](https://github.com/loopbackio/loopback-connector-mysql/blob/master/lib/discovery.js#L78) to the line.
If we look at [MySQL docs](https://dev.mysql.com/doc/refman/8.4/en/glossary.html#glos_schema), the database name is supposed to be synonymous with `table_schema`. Hence, fetching all tables doesn't make sense if no schema is provided. It should take the DB name as a schema.
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 in lib/discovery.js at the linked line and trace discovery when no schema is provided and the all flag is false. Verify how the MySQL database name is available and confirm the completed behavior uses it as table_schema instead of fetching tables without a schema.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, mysql
- Domain
- databases
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 55/100