1
0
mirror of https://github.com/lana-k/sqliteviz.git synced 2025-12-08 02:58:54 +08:00
This commit is contained in:
lana-k
2022-06-24 21:29:40 +02:00
parent a20dd7f849
commit 518b22b489
15 changed files with 193 additions and 16 deletions

View File

@@ -56,6 +56,7 @@ import DataView from './DataView'
import RunResult from './RunResult'
import time from '@/lib/utils/time'
import Teleport from 'vue2-teleport'
import { send } from '@/lib/utils/events'
export default {
name: 'Tab',
@@ -121,11 +122,33 @@ export default {
const start = new Date()
this.result = await state.db.execute(this.query + ';')
this.time = time.getPeriod(start, new Date())
if (this.result && this.result.values) {
send({
category: 'resultset',
action: 'create',
value: this.result.values[this.result.columns[0]].length
})
}
send({
category: 'query',
action: 'run',
value: this.time,
label: 'status=success'
})
} catch (err) {
this.error = {
type: 'error',
message: err
}
send({
category: 'query',
action: 'run',
value: 0,
label: 'status=error'
})
}
state.db.refreshSchema()
this.isGettingResults = false