/* eslint-disable @typescript-eslint/explicit-module-boundary-types */
const pool = require("./connect");
import {QueryError, RowDataPacket} from 'mysql2';

interface definitionInterface{
    (message:string):void;
}
export default function Select(sql: string, callback: definitionInterface) {
pool.query('SELECT * FROM `members` WHERE 1', (err: QueryError, rows: RowDataPacket[]) => {
    return callback(rows);
});
}

/*export default function Select(sql: string, callback: definitionInterface) {
    pool.getConnection(function(err, conn) {
        conn.query(sql , function(err, rows) {
            callback(rows);
         });
        pool.releaseConnection(conn);
     })

  }*/