Skip to content

Commit 47cbd75

Browse files
committed
support to show the native sql
1 parent 41c9b16 commit 47cbd75

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

console/atest-ui/src/views/DataManager.vue

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ interface QueryData {
5050
}
5151
5252
const queryDataFromTable = (data: QueryData) => {
53-
sqlQuery.value = `select * from ${data.label} limit 100`
53+
sqlQuery.value = `@selectTableLImit100_${data.label}`
5454
executeQuery()
5555
}
5656
const queryTables = () => {
@@ -84,7 +84,7 @@ API.GetStores((data) => {
8484
8585
const ormDataHandler = (data: QueryData) => {
8686
const result = [] as any[]
87-
const cols = new Set()
87+
const cols = new Set<string>()
8888
8989
data.items.forEach(e => {
9090
const obj = {}
@@ -95,6 +95,14 @@ const ormDataHandler = (data: QueryData) => {
9595
result.push(obj)
9696
})
9797
98+
data.meta.labels = data.meta.labels.filter((item) => {
99+
if (item.key === '_native_sql') {
100+
sqlQuery.value = item.value
101+
return false
102+
}
103+
return !item.key.startsWith('_')
104+
})
105+
98106
queryDataMeta.value = data.meta
99107
queryResult.value = result
100108
queryResultAsJSON.value = JSON.stringify(result, null, 2)

0 commit comments

Comments
 (0)