Should we not wait for callbacks after methods connect and end in mysql NPM lib?

30 views
Skip to first unread message

João Pimentel Ferreira

unread,
Jun 28, 2022, 8:54:58 AM6/28/22
to node-mysql

I made this same question on SO.

The npm lib mysql says I should use it like this

Capture.JPG

Is this really correct? Should we end the connection before the callback? Should we not query only after the connect() has finished?

In all my projects I've been using async.series to be sure these steps are run sequentially:

Capture2.JPG

Am I being too verbose?

Thanks

Reply all
Reply to author
Forward
0 new messages