一波优化

master 3.0.10
宇天 2019-09-23 16:17:25 +08:00
parent e45183ceb8
commit 496b3cbde9
4 changed files with 5 additions and 4 deletions

View File

@ -1,4 +1,5 @@
# 3.0.9 / 2019-09-23
# 3.0.10 / 2019-09-23
* 优化数据库/表的删除判断;
* 优化创建数据库/表时的默认配置顶;
* 优化字段的默认值0的判断

View File

@ -79,7 +79,7 @@ class Api {
let defer = Promise.defer()
this.connect().then(conn => {
conn.query(`DROP DATABASE ${db || this.db}`, (err, result) => {
conn.query(`DROP DATABASE IF EXISTS \`${db || this.db}\``, err => {
conn.release()
if (err) {
return defer.reject(new SqlErr(`Drop database ${err}`))

View File

@ -302,7 +302,7 @@ class Method {
}
drop() {
let sql = `DROP TABLE ${this.cache.table} `
let sql = `DROP TABLE IF EXISTS \`${this.cache.table}\` `
return this.connect().then(conn => {
const defer = Promise.defer()

View File

@ -1,6 +1,6 @@
{
"name": "mysqli",
"version": "3.0.9",
"version": "3.0.10",
"description": "MySQL tool",
"main": "index.js",
"dependencies": {