Files
graphql/db/index.js
2024-09-27 01:16:59 +08:00

22 lines
460 B
JavaScript

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();