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

add dataBase lib

This commit is contained in:
lana-k
2020-10-20 19:05:38 +02:00
parent aae47eff86
commit 5a8b2584ff
6 changed files with 56 additions and 69 deletions

View File

@@ -89,7 +89,6 @@ export default {
result: null,
view: 'table',
tableViewHeight: 0,
worker: this.$store.state.worker,
isUnsaved: !this.name
}
},
@@ -164,18 +163,10 @@ export default {
},
// Run a command in the database
execute (commands) {
this.worker.onmessage = (event) => {
// if it was more than one select - take only the first one
this.result = event.data.results[0]
if (!this.result) {
console.log(event.data.error)
// return
}
// this.$refs.output.innerHTML = ''
}
this.worker.postMessage({ action: 'exec', sql: commands })
// this.$refs.output.textContent = 'Fetching results...'
// this.$refs.output.textContent = 'Fetching results...' */
this.$db.execute(commands)
.then(result => { this.result = result })
.catch(err => alert(err))
},
execEditorContents () {
this.execute(this.query + ';')