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.
17 lines
521 B
17 lines
521 B
// Загрузка категорий продукта
|
|
const pool = require("./connect");
|
|
interface definitionInterface{
|
|
(message:string):void;
|
|
}
|
|
|
|
export default function Select(sql: string, callback: definitionInterface) {
|
|
pool.getConnection(function(err, conn) {
|
|
// Do something with the connection
|
|
conn.query(sql , function(err, rows) {
|
|
callback(rows);
|
|
});
|
|
// Don't forget to release the connection when finished!
|
|
pool.releaseConnection(conn);
|
|
})
|
|
|
|
} |