sidorares / sidorares/node-mysql2
execute/query from json like tokenized params
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 4.4k
- Forks
- 680
- Avg merge
- 9h 7m
- Merged PRs (30d)
- 59
Description
do we have feature like this ? i am unable to get it work using mysql2
pool.query( 'SELECT * FROM tablename WHERE col1 = :pid AND col2 = :tid', {pid:5, tid:6} )
.then((rs)=>{console.log(rs)})
.catch((e)=>{console.log(e)})
this gives error.... i have tried pool.execute() as well but no luck.
of-course i can build the query manually by doing a string replace and escape params etc.
but i thought this is a basic feature. and i am aware of features like using the "?", but i need it this way.
could not find this kinda examples in the doc, which uses named placeholders.
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 request concerns pool.query and pool.execute with :pid and :tid named placeholders. Start by checking the query/execute API documentation and existing placeholder-handling tests; done means either documented named-parameter behavior with a passing example or a clearly stated unsupported limitation.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- mysql, nodejs, typescript
- Domain
- database
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 30/100