How to use the default function from mysql

Find comprehensive JavaScript mysql.default code examples handpicked from public code repositorys.

28
29
30
31
32
33
34
35
36
37
exports.getUserStats = exports.deleteComment = exports.insertComment = exports.getComments = exports.getResource = exports.getItemsByCategory = exports.getSearchItems = exports.deleteResource = exports.updatePendingStatus = exports.getPendingSubmittals = exports.insertRersource = exports.getUserByEmail = exports.getUserById = exports.insertUser = exports.connection = void 0;
const dotenv = __importStar(require("dotenv"));
const mysql_1 = __importDefault(require("mysql"));
const uuid_1 = require("uuid");
dotenv.config();
exports.connection = mysql_1.default.createConnection(process.env.DATABASE_URL);
const insertUser = (firstName, lastName, email, hashedPassword, dateJoined, role) => {
    return new Promise((resolve, reject) => {
        const userId = (0, uuid_1.v4)();
        const sql = "INSERT INTO person (id, first_name, last_name, email, password, date_joined, role) VALUES (?, ?, ?, ?, ?, ?, ?)";
fork icon0
star icon1
watch icon1