mirror of
https://github.com/darksaid98/oxmysql.git
synced 2026-12-01 22:21:51 +00:00
15 lines
423 B
JavaScript
15 lines
423 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',
|
|
user: config.username || 'root',
|
|
password: config.password || '',
|
|
database: config.endpoint || 'es_extended',
|
|
charset: 'utf8mb4_unicode_ci',
|
|
...config.options,
|
|
namedPlaceholders: true,
|
|
typeCast: parseTypes,
|
|
});
|