opcion b
This commit is contained in:
@@ -6,7 +6,6 @@ const pool = mariadb.createPool({
|
||||
user: process.env.ESCOLARES_USER,
|
||||
password: process.env.ESCOLARES_PASSWORD,
|
||||
database: process.env.ESCOLARES_DB,
|
||||
connectionLimit: 5,
|
||||
});
|
||||
|
||||
const obtenerAlumno = async (numeroCuenta) => {
|
||||
@@ -18,32 +17,15 @@ const obtenerAlumno = async (numeroCuenta) => {
|
||||
.query(`CALL busca_alumno_pcpuma('${numeroCuenta}')`)
|
||||
.then((rows) => {
|
||||
conn.end();
|
||||
console.log(rows.length);
|
||||
console.log(rows[0].length);
|
||||
console.log(rows);
|
||||
return rows[0][0];
|
||||
})
|
||||
.catch((err) => {
|
||||
conn.end();
|
||||
throw new Error('Hubo un problema con el querry.' + err);
|
||||
});
|
||||
|
||||
// return pool
|
||||
// .getConnection()
|
||||
// .then((conn) => {
|
||||
// return conn
|
||||
// .query(`CALL busca_alumno_pcpuma('${numeroCuenta}')`)
|
||||
// .then((rows) => {
|
||||
// conn.end();
|
||||
// return rows[0][0];
|
||||
// })
|
||||
// .catch((err) => {
|
||||
// console.log(err);
|
||||
// conn.end();
|
||||
// throw new Error('Hubo un problema con el querry.');
|
||||
// });
|
||||
// })
|
||||
// .catch((err) => {
|
||||
// console.log(err);
|
||||
// throw new Error('No se pudo conectar con la db.' + err);
|
||||
// });
|
||||
};
|
||||
|
||||
module.exports = obtenerAlumno;
|
||||
|
||||
Reference in New Issue
Block a user