chore: let the sql query input be empty (#637)

* chore: let the sql query input be empty

* empty the sql query when switch the store

---------

Co-authored-by: rick <linuxsuren@users.noreply.github.com>
This commit is contained in:
Rick 2025-03-04 19:55:45 +08:00 committed by GitHub
parent 1372e6d21d
commit 5372c556df
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 6 additions and 4 deletions

View File

@ -23,23 +23,25 @@ watch(store, (s) => {
return
}
})
currentDatabase.value = ''
sqlQuery.value = ''
executeQuery()
})
const queryDataFromTable = (data) => {
sqlQuery.value = `select * from ${data.label} limit 10`
executeQuery()
}
const queryTables = () => {
sqlQuery.value = `show tables`
sqlQuery.value = ``
executeQuery()
}
watch(kind, (k) => {
switch (k) {
case 'atest-store-orm':
sqlQuery.value = 'show tables'
queryTip.value = 'Enter SQL query'
break;
case 'atest-store-etcd', 'atest-store-redis':
sqlQuery.value = ''
case 'atest-store-etcd':
case 'atest-store-redis':
queryTip.value = 'Enter key'
break;
}