loopback-connector-mysql icon indicating copy to clipboard operation
loopback-connector-mysql copied to clipboard

Switch from `mysql` to `mysql2`

Open 8secz-johndpope opened this issue 5 years ago • 4 comments

https://www.npmjs.com/package/mysql2

seems like mysql2 has a bump in performance.

MySQL client for Node.js with focus on performance. Supports prepared statements, non-utf8 encodings, binary log protocol, compression, ssl

8secz-johndpope avatar Aug 25 '20 02:08 8secz-johndpope

Screen Shot 2020-08-25 at 1 03 29 pm

I ran test suite and seems to pass.

8secz-johndpope avatar Aug 25 '20 03:08 8secz-johndpope

Hi @8secz-johndpope, there is no particular reason. The connector was created before mysql2 even existed, we haven't had bandwidth to look for alternative drivers and evaluate if it's worth switching.

From what I remember, dealing with types like Date, Time and DateTime can be tricky, especially regarding the timezones. Does mysql2 handle time-related types the same way as mysql?

Our main issue with mysql is lack of support for new authentication protocols introduced by MySQL version 8 (see https://github.com/mysqljs/mysql/issues/2002). It would be a great reason for switching if mysql2 supported them. I am not sure if that's the case though - see https://github.com/sidorares/node-mysql2/issues/991, https://github.com/sidorares/node-mysql2/issues/906 and related issues.

bajtos avatar Aug 28 '20 13:08 bajtos

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Dec 25 '20 13:12 stale[bot]

Fixed with https://github.com/loopbackio/loopback-connector-mysql/pull/484

samarpanB avatar Jun 26 '23 10:06 samarpanB