/ley-driver-mysql2-esm

A copy of @lukeed's mysql2 ley driver, but this support ESM migrations. Not useful if you use ley@0.7.0 or later

Primary LanguageJavaScript

ley-driver-mysql2-esm

ESM-compatible mysql2 driver for @lukeed/ley

how is it different?

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✨✨

how?

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 and mysql2 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.

license/credit

MIT

Original copyright: Luke Edwards 2021

The code was copied from: https://github.com/lukeed/ley/blob/master/lib/clients/mysql2.js