node-promise-mysql | wraps function calls with Bluebird promises | Reactive Programming library
kandi X-RAY | node-promise-mysql Summary
kandi X-RAY | node-promise-mysql Summary
node-promise-mysql
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of node-promise-mysql
node-promise-mysql Key Features
node-promise-mysql Examples and Code Snippets
Community Discussions
Trending Discussions on node-promise-mysql
QUESTION
I'm pretty new to the node world and trying to migrate our php application to node. To be able to return all article data several different queries have to be done depending on the results of the first query. Currently my data object is empty as it's returned before the two queries run. How can I "chain" these queries using a promised based approach.
I found a library https://github.com/lukeb-uk/node-promise-mysql which I think could help but I have no idea how to implement it with my code.
...ANSWER
Answered 2017-Oct-23 at 16:13The functionality you are looking for is Promise chaining, it allows you to construct a sequence of promises, each depending on the result of the previous value. Applying this to your code, you would get something like this:
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install node-promise-mysql
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page