1
0
mirror of https://github.com/lana-k/sqliteviz.git synced 2025-12-07 10:38:54 +08:00
This commit is contained in:
lana-k
2021-04-27 22:51:36 +02:00
parent 35baaf2722
commit 9ed53e0d25
13 changed files with 105 additions and 25 deletions

View File

@@ -73,7 +73,7 @@ class Database {
throw new Error(res.error)
}
return this.getSchema(file.name)
return this.getSchema(file.name.replace(/\.[^.]+$/, ''))
}
async getSchema (name) {
@@ -108,6 +108,15 @@ class Database {
// if it was more than one select - take only the last one
return results[results.length - 1]
}
async export (fileName) {
const data = await this.pw.postMessage({ action: 'export' })
if (data.error) {
throw new Error(data.error)
}
fu.exportToFile(data, fileName)
}
}
function getAst (sql) {