ESM-compatible mysql2 driver for @lukeed/ley
instead of your migration looking like this...
const whatever = require('whatever')
exports.up = async client => {
// ...
}
exports.down = async client => {
// ...
}
...you can now write your exports like this...
import whatever from 'whatever'
export const up = async client => {
// ...
}
export const down = async client => {
// ...
}
✨✨awesome✨✨
npm install ley --save # if not installed yet
npm install mysql2 --save # if not installed yet
npm install @trex-arms/ley-driver-mysql2-esm --save
Important:
ley
andmysql2
must be installed separately. That way, you control which versions you want to use.
Then, toss this driver
param into your ley.config.js
:
{
driver: require('@trex-arms/ley-driver-mysql2-esm'),
// ...
}
Or include the driver another way.
Original copyright: Luke Edwards 2021
The code was copied from: https://github.com/lukeed/ley/blob/master/lib/clients/mysql2.js