You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
25 lines
751 B
25 lines
751 B
/* eslint-disable @typescript-eslint/explicit-module-boundary-types */
|
|
const pool = require("./connect");
|
|
import {QueryError, OkPacket} from 'mysql2';
|
|
|
|
interface definitionInterface{
|
|
(message:string):void;
|
|
}
|
|
export default function Insert(sql: string, argument: string[], callback: definitionInterface) {
|
|
console.log(argument);
|
|
callback(argument);
|
|
// pool.execute(sql, argument, (err: QueryError, result: OkPacket) => {
|
|
// callback(result);
|
|
// pool.releaseConnection(pool);
|
|
// });
|
|
}
|
|
|
|
/*export default function Select(sql: string, callback: definitionInterface) {
|
|
pool.getConnection(function(err, conn) {
|
|
conn.query(sql , function(err, rows) {
|
|
callback(rows);
|
|
});
|
|
|
|
})
|
|
|
|
}*/ |