sidorares / sidorares/node-mysql2
only resolve named placeholders if values is an object
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 4.4k
- Forks
- 680
- Avg merge
- 9h 7m
- Merged PRs (30d)
- 59
Description
Would it be an idea, to only resolve named placeholders for options.sql when type of options.values is an object.
The problem is, that I can not set namedPlaceholder: true in the general config, and then execute a query like: conn.execute('SELECT * FROM items WHERE id = ?;', [ id ]);
I think the namedPlaceholders config should simply be to allow for named placeholders, but still work with the other query methods.
If I create tests and PR, are you interested in accepting it and make a release? Or where are you in your release plans.
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
The issue does not name files or tests. Start by reproducing the positional conn.execute query with namedPlaceholders enabled and trace how options.values and placeholders are handled. Done means named placeholders still work with object values while positional queries continue to work with array values.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- mysql, node.js, typescript
- Domain
- backend, databases
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100