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:
@@ -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 })
|
||||
|
||||
Reference in New Issue
Block a user