Class MysqlDialect

MySQL dialect that uses the mysql2 library.

The constructor takes an instance of MysqlDialectConfig.

import { createPool } from 'mysql2'

new MysqlDialect({
pool: createPool({
database: 'some_db',
host: 'localhost',
})
})

If you want the pool to only be created once it's first used, pool can be a function:

import { createPool } from 'mysql2'

new MysqlDialect({
pool: async () => createPool({
database: 'some_db',
host: 'localhost',
})
})

Hierarchy

  • MysqlDialect

Implements

Constructors

Methods

Generated using TypeDoc