import {createConnection, QueryError, RowDataPacket} from 'mysql2';
import type { NextApiResponse } from 'next';

type Pool = {
    name: string
  }


export default function init(
    res: NextApiResponse<Pool>
  ) {
    const Pool = createConnection({
        host: process.env.HOST,
        user: process.env.DATABASE,
        database: process.env.DATABASE,
        password: process.env.PASSWORD,
        waitForConnections: true,
        connectionLimit: 10,
        queueLimit: 0
    });
    return Pool;
  }
