bugfix
This commit is contained in:
parent
5b31b4bf98
commit
08f303de8f
2
index.js
2
index.js
@ -0,0 +1,2 @@
|
||||
const dbUtils = require('./utils/dbUtils');
|
||||
const dbPoolUtils = require('./utils/dbPoolUtils');
|
@ -80,6 +80,7 @@ function close() {
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
createPool: createPool,
|
||||
query: query,
|
||||
close: close,
|
||||
}
|
@ -4,13 +4,14 @@ const fs = require('fs');
|
||||
const path = require('path');
|
||||
|
||||
let globalConfig = JSON.parse(fs.readFileSync(path.join(__dirname, '../config.json'), 'utf8'));
|
||||
let config = {
|
||||
...globalConfig.mysql,
|
||||
};
|
||||
console.log(config);
|
||||
|
||||
async function query(sql) {
|
||||
//通过MySQL中方法创建链接对象
|
||||
let config = {
|
||||
...globalConfig.mysql,
|
||||
};
|
||||
console.log(config);
|
||||
|
||||
//通过MySQL中方法创建连接对象
|
||||
var connection = mysql.createConnection(config);
|
||||
//开始连接
|
||||
connection.connect();
|
||||
|
Loading…
Reference in New Issue
Block a user