v5-docs icon indicating copy to clipboard operation
v5-docs copied to clipboard

Update to mysql2

Open McSneaky opened this issue 3 years ago • 4 comments

🔗 Linked issue

❓ Type of change

  • [ ] 🐞 Bug fix (a non-breaking change that fixes an issue)
  • [x] 👌 Enhancement (improving an existing functionality like performance)
  • [ ] ✨ New feature (a non-breaking change that adds functionality)
  • [ ] ⚠️ Breaking change (fix or feature that would cause existing functionality to change)

📚 Description

Updating to mysql2 allows to use MySQL 8 and above. There's been issue opened in mysql repo, but seems like it's stale https://github.com/mysqljs/mysql/issues/1959

mysql2 is API compatible with mysql so there really shouldn't be any breaking changes

📝 Checklist

  • [ ] I have linked an issue or discussion.
  • [x] I have updated the documentation accordingly.

McSneaky avatar Aug 19 '22 01:08 McSneaky

Cool. Can you please also send a PR for the Lucid repo. We have to update the client inside the config file to mysql2 and also install mysql2 dialect.

https://github.com/adonisjs/lucid/blob/develop/templates/database.txt#L72 https://github.com/adonisjs/lucid/blob/develop/instructions.ts#L82

thetutlage avatar Aug 19 '22 09:08 thetutlage

Added: https://github.com/adonisjs/lucid/pull/871

McSneaky avatar Aug 21 '22 16:08 McSneaky

Is there need for another dialect tho? Since it's drop in replacement and seems to be already added https://github.com/adonisjs/lucid/blob/5d006b8013c415a53d0b250dc9de59c473cf1fcd/src/Dialects/index.ts#L21

McSneaky avatar Aug 21 '22 16:08 McSneaky

Is there need for another dialect tho? Since it's drop in replacement and seems to be already added

Oh yeah, I changed that to see if all of our tests are green. If yes, then we can use mysql2 in tests and also recommend it as the default dialect

thetutlage avatar Aug 22 '22 07:08 thetutlage

Oops, I have done it by myself! 😅

RomainLanz avatar Oct 22 '22 22:10 RomainLanz