This commit is contained in:
Lemuel Marquez
2021-05-19 01:25:33 -05:00
parent b5c332e07d
commit ee17f0b880
+22 -18
View File
@@ -9,21 +9,25 @@ const pool = mariadb.createPool({
connectionLimit: 5,
});
pool
.getConnection()
.then((conn) => {
conn
.query("CALL busca_alumno_pcpuma('316313528')")
.then((rows) => {
console.log(rows);
conn.end();
})
.catch((err) => {
//handle error
console.log(err);
conn.end();
});
})
.catch((err) => {
//not connected
});
const obtenerAlumno = (numeroCuenta) => {
return pool
.getConnection()
.then((conn) => {
conn
.query(`CALL busca_alumno_pcpuma('${numeroCuenta}')`)
.then((rows) => {
conn.end();
return rows;
})
.catch((err) => {
console.log(err);
conn.end();
});
})
.catch((err) => {
//not connected
});
};
console.log('hola');
console.log(obtenerAlumno('316313528'));