29 lines
592 B
JavaScript
29 lines
592 B
JavaScript
require('./config');
|
|
const mariadb = require('mariadb');
|
|
|
|
const pool = mariadb.createPool({
|
|
host: process.env.ESCOLARES_HOST,
|
|
user: process.env.ESCOLARES_USER,
|
|
password: process.env.ESCOLARES_PASSWORD,
|
|
database: process.env.ESCOLARES_DB,
|
|
});
|
|
|
|
pool
|
|
.getConnection()
|
|
.then((conn) => {
|
|
conn
|
|
.query("CALL busca_alumno_pcpuma('412123573')")
|
|
.then((rows) => {
|
|
console.log(rows);
|
|
conn.end();
|
|
})
|
|
.catch((err) => {
|
|
//handle error
|
|
console.log(err);
|
|
conn.end();
|
|
});
|
|
})
|
|
.catch((err) => {
|
|
//not connected
|
|
});
|