Open mems opened 6 years ago
yes, what's your question @mems ?
Just to add that clarification in docs
agreed, just had a look at /documentation/Promise-Wrapper.md
and we should probably have good detailed api documentation there and not just couple of brief examples
Yes this is important, because i've seen people manually accquire and release connection when working with query and execute, which is not necessary as @mems has highlighted.
I agree with this. I went from using execute
(implicit connection) to using transactions (user managed connection) and I got bit by a pool deadlock.
what bout if I use 'mysql2/promise' ? connection = await mysql.createConnection({ ... }) const [rows] = await connection.execute( ... ) Should I call connection.end() after ?
Should I call connection.end() after ?
@frenzymind depends on your use case, but at some point before you exit from your app you need to close connection.
The docs should mention that methods of connection pool
execute()
andquery()
internally create and release a connection each time it called: