How to use the default function from mysql
Find comprehensive JavaScript mysql.default code examples handpicked from public code repositorys.
GitHub: Jherlin/student-resources
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 (?, ?, ?, ?, ?, ?, ?)";
0
1
1
mysql.createConnection is the most popular function in mysql (283 examples)