empty the sql query when switch the store

This commit is contained in:
rick 2025-03-04 08:58:09 +00:00
parent b46114cb6f
commit 2f3d09a16f
1 changed files with 6 additions and 5 deletions

View File

@ -23,24 +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 = ''
queryTip.value = 'Enter SQL query'
executeQuery()
break;
case 'atest-store-etcd', 'atest-store-redis':
sqlQuery.value = ''
case 'atest-store-etcd':
case 'atest-store-redis':
queryTip.value = 'Enter key'
break;
}