diff --git a/lib/utils.js b/lib/utils.js index 9725121..13a217a 100644 --- a/lib/utils.js +++ b/lib/utils.js @@ -275,9 +275,7 @@ const parser = { indexes.push(idx) } } - sql += `\`${it.name}\` ${ - it.type - } ${notnull} ${defaultVal} ${inc} ${autoUpdate},\n` + sql += `\`${it.name}\` ${it.type} ${notnull} ${defaultVal} ${inc} ${autoUpdate},\n` } if (!primary) { throw new Error('Can not create table without primary key.') @@ -294,14 +292,15 @@ const parser = { class SqlErr { constructor(msg = '', sql = '') { + var line = '-'.repeat(50) + this.message = msg this.sql = sql hideProperty(this, 'stack', msg) console.error( - '-'.repeat(50), - `[${new Date().format('Y/m/d_H:i:s')}][Last Query SQL]: ${sql}`, - `Query ${msg}`, - '-'.repeat(50) + line + + `\n[${new Date().format('Y/m/d_H:i:s')}][Last Query SQL]: ${sql}\nQuery ${msg}\n` + + line ) } diff --git a/package.json b/package.json index f24c963..bef336f 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "mysqli", - "version": "3.1.2", + "version": "3.1.3", "description": "MySQL tool", "main": "index.js", "dependencies": {