This topic was automatically generated from Slack. You can find the original thread here.
Jared Ledbetter : MySQL is not taking any action. Any insight on this? I’ve checked the async functions and have tried adding the await option to each function individually, but can’t seem to locate the correct one.
Console.log
This step was still trying to run code when the step ended. Make sure you promisify callback functions and await all Promises. (Reason: Socket, Learn more: https://pipedream.com/docs/workflows/steps/code/async)
Dylan Sather (Pipedream) : right now, you’re executing the query inside of a callback function, which isn’t supported on Pipedream. You may have seen the doc included in that warning - Running asynchronous code - which tells you a bit more information about this, and how to modify your code accordingly.
This is the primary reason the code we use in the MySQL test request uses the mysql2/promise package - that library supports Promises, which allows you to run code like this:
Dylan Sather (Pipedream) : Can you check your database to confirm the INSERT didn’t actually go through? This warning can be a false positive, so I’d like to see if the record actually appeared in your database.
You can also add a console.log(rows) statement at the end of your code step to print the results of the query.