Files
oxmysql/src/pool.js
T
Linden 681b39692a fix(pool): Increase default connection timeout
- Servers taking a while to start may experience a timeout; this should alleviate the issue
2021-09-27 10:13:11 +10:00

17 lines
486 B
JavaScript

import { createPool } from 'mysql2/promise';
import { config } from './config';
import { parseTypes } from './parser';
export const pool = createPool({
host: config.hosts[0].host || 'localhost',
port: config.hosts[0].port || 3306,
user: config.username || 'root',
password: config.password || '',
database: config.endpoint || 'es_extended',
charset: 'utf8mb4_unicode_ci',
connectTimeout: 30000,
...config.options,
namedPlaceholders: true,
typeCast: parseTypes,
});