1
0
mirror of https://github.com/lana-k/sqliteviz.git synced 2025-12-08 02:58:54 +08:00

events refactor

This commit is contained in:
lana-k
2022-06-25 22:37:09 +02:00
parent 48e311bff8
commit d56604a7d6
14 changed files with 66 additions and 100 deletions

View File

@@ -79,13 +79,9 @@ class Database {
this.dbName = file ? fu.getFileName(file) : 'database'
this.refreshSchema()
send({
category: 'database',
action: 'import',
value: file ? file.size : 0,
label: file
? 'from=sqlite new_db=true'
: 'from=none new_db=true'
send('database.import', file ? file.size : 0, {
from: file ? 'sqlite' : 'none',
new_db: true
})
}
@@ -125,12 +121,7 @@ class Database {
throw new Error(data.error)
}
fu.exportToFile(data, fileName)
send({
category: 'database',
action: 'export',
value: data.byteLength,
label: 'to=sqlite'
})
send('database.export', data.byteLength, { to: 'sqlite' })
}
async validateTableName (name) {