// const mariadb = require('mariadb')
import * as mariadb from 'mariadb';
const dotenv = require('dotenv')
dotenv.config();


const pool = mariadb.createPool({
    host: process.env.DB_HOST,
    port: Number(process.env.DB_PORT),
    user: process.env.DB_USERNAME,
    password: process.env.DB_PASSWORD,
    connectionLimit: 5,
    connectTimeout: 10000,        // give it more breathing room
    acquireTimeout: 15000,
    database: 'ranger_unit_tracker',
    ssl: false,
});

export default pool;