Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| c58565af77 | |||
| 66d29fa4b6 |
@@ -826,6 +826,8 @@ export default function () {
|
|||||||
res
|
res
|
||||||
.status(500)
|
.status(500)
|
||||||
.json({ message: 'Database error fetching manager permissions.', details: error.message })
|
.json({ message: 'Database error fetching manager permissions.', details: error.message })
|
||||||
|
} finally {
|
||||||
|
db.release()
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|||||||
+2
-2
@@ -13,8 +13,8 @@ const db = mysql.createPool({
|
|||||||
database: process.env.DB_NAME,
|
database: process.env.DB_NAME,
|
||||||
port: process.env.DB_PORT,
|
port: process.env.DB_PORT,
|
||||||
waitForConnections: true,
|
waitForConnections: true,
|
||||||
connectionLimit: 10,
|
connectionLimit: 50,
|
||||||
queueLimit: 0,
|
queueLimit: 100,
|
||||||
// timezone: '+08:00',
|
// timezone: '+08:00',
|
||||||
dateStrings: true,
|
dateStrings: true,
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -0,0 +1,22 @@
|
|||||||
|
import { getConnection } from './pool.js'
|
||||||
|
// import mysql from 'mysql2/promise'
|
||||||
|
//
|
||||||
|
//
|
||||||
|
//
|
||||||
|
// export const db = mysql.createPool({
|
||||||
|
// host: '47.254.195.2',
|
||||||
|
// user: 'nilai_clock_indo',
|
||||||
|
// password: '5jHy8ZsfeEjPAhYS',
|
||||||
|
// database: 'nilai_clock_indo',
|
||||||
|
// port: 3306,
|
||||||
|
// waitForConnections: true,
|
||||||
|
// connectionLimit: 10,
|
||||||
|
// queueLimit: 0,
|
||||||
|
// dateStrings: true,
|
||||||
|
// // 不在这里设置timezone,因为我们用查询设置
|
||||||
|
// });
|
||||||
|
|
||||||
|
const conn = await getConnection()
|
||||||
|
|
||||||
|
const [rows] = await conn.execute('select * from clock_records where id= 6654');
|
||||||
|
console.log(rows);
|
||||||
Reference in New Issue
Block a user