first commit
This commit is contained in:
22
db/index.js
Normal file
22
db/index.js
Normal file
@@ -0,0 +1,22 @@
|
||||
const mysql = require('yn-mysql-utils')
|
||||
|
||||
class DB {
|
||||
constructor () {
|
||||
this.data = new mysql({
|
||||
host : '127.0.0.1',
|
||||
user : 'root',
|
||||
password : 'lb714500',
|
||||
database : 'shop',
|
||||
connectionLimit : 10
|
||||
});
|
||||
}
|
||||
|
||||
async Query(params) {
|
||||
return await this.data.Query({
|
||||
sql: params.sql,
|
||||
par: params.data
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = new DB();
|
||||
Reference in New Issue
Block a user