-
Notifications
You must be signed in to change notification settings - Fork 3
/
procedure.test.js
35 lines (32 loc) · 1.24 KB
/
procedure.test.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
const dotenv = require("dotenv").config()
const {
sendMultiple
} = require("@sendgrid/mail");
const mysql = require('mysql2');
let pool = mysql.createPool({
multipleStatements: true,
host: process.env.db_host,
user: process.env.db_user,
password: process.env.db_password,
database: process.env.db,
ssl: {
ca: process.env.db_ca,
key: process.env.db_key,
cert: process.env.db_cert
}
});
pool = pool.promise();
(async () => {
try {
// let id, email, temp, isVerified;
let reply = await pool.query("CALL Reg(?, ?, ?, ?, ?, ?, ?, ?, ?, ?);", ["[email protected]", "sjfbsdhfbsudhfbuhsdb", "omkaragrawal", 1234567890, "sfsdv", "Mumbai", "India", 401107, "sgdvsg", "hsdvghs"]);
const data = reply[0][0][0];
console.table([{id: data.id, email: data.email, status: data["@status"], isVerified: data.isVerified}]);
// SELECT id, email , @status, isVerified FROM user WHERE email = UEmail;
// SELECT @id:=(user.`id`),@UEmail1:=(user.`email`) , @status, @isVerified:=(user.`isVerified`) FROM user WHERE email = UEmail;
// console.log(data);
} catch (err) {
console.log(err);
}
await pool.end();
})()