master
宇天 2021-08-23 16:34:49 +08:00
parent 1a7dd811dd
commit c4b1968b10
2 changed files with 7 additions and 8 deletions

View File

@ -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
)
}

View File

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