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

add changing db in schema pane

This commit is contained in:
lana-k
2020-09-26 19:16:24 +02:00
parent 4b8a993921
commit 5972d535cc
4 changed files with 59 additions and 60 deletions

View File

@@ -15,12 +15,10 @@ export default {
worker: this.$store.state.worker
}
},
created () {
// Open a database
this.$store.state.worker.postMessage({ action: 'open' })
},
methods: {
loadDb () {
const dbName = this.$refs.dbfile.value.substr(this.$refs.dbfile.value.lastIndexOf('\\') + 1)
this.$store.commit('saveDbName', dbName)
const f = this.$refs.dbfile.files[0]
const r = new FileReader()
r.onload = () => {
@@ -31,7 +29,6 @@ export default {
WHERE type='table' AND name NOT LIKE 'sqlite_%';`
this.worker.onmessage = event => {
this.$store.commit('saveSchema', event.data.results[0].values)
// this.schema = event.data.results[0].values
this.$router.push('/editor')
}
this.worker.postMessage({ action: 'exec', sql: getSchemaSql })