mirror of
https://github.com/lana-k/sqliteviz.git
synced 2025-12-07 10:38:54 +08:00
Export db #34
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user