MySQL Forums
Forum List  »  Connector/Node.js

Re: await in NodeJs
Posted by: Rui Quelhas
Date: December 23, 2020 06:47AM

Hi Henry,

there is no problem. If you are using the "mysql" driver you can't use async/await because the API doesn't return JavaScript Promises. Asynchronous execution is handled through callback functions as depicted by the driver's documentation and my last comment.

If you still want to use a driver that supports async/await, you can use either @mysql/xdevapi (the official one, which we maintain) or mysql2 which is also a community-driven project.

Hope it helps.

Options: ReplyQuote


Subject
Written By
Posted
September 12, 2020 07:08AM
September 18, 2020 03:53AM
September 18, 2020 08:30AM
September 19, 2020 10:41AM
December 22, 2020 05:29AM
Re: await in NodeJs
December 23, 2020 06:47AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.