Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 'use strict'
- const mariadb = require('mariadb');
- const pool = mariadb.createPool({
- host: 'localhost',
- user: 'root',
- password: 'yourpassword',
- database: 'lotto',
- connectionLimit: 5
- });
- async function check(req, callback) {
- let conn;
- try {
- conn = await pool.getConnection();
- const rows = await conn.query("");
- callback();
- } catch (err) {
- throw err;
- } finally {
- if (conn) return conn.end();
- }
- }
- module.exports = {
- check
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement