File tree Expand file tree Collapse file tree 1 file changed +18
-1
lines changed
console/atest-ui/src/views Expand file tree Collapse file tree 1 file changed +18
-1
lines changed Original file line number Diff line number Diff line change @@ -48,12 +48,18 @@ const tablesTree = ref([] as TreeItem[])
48
48
const storeChangedEvent = (s : string ) => {
49
49
kind .value = ' '
50
50
SetDataManagerPreference (' currentStore' , s )
51
+ queryDataMeta .value .currentDatabase = " "
51
52
stores .value .forEach ((e : Store ) => {
52
53
if (e .name === s ) {
53
54
kind .value = e .kind .name
54
55
switch (GetDriverName (e )){
55
56
case Driver .MySQL :
56
57
sqlConfig .value .dialect = MySQL
58
+ e .properties .forEach ((p : Pair ) => {
59
+ if (p .key === ' database' ) {
60
+ queryDataMeta .value .currentDatabase = p .value
61
+ }
62
+ })
57
63
break ;
58
64
case Driver .Postgres :
59
65
sqlConfig .value .dialect = PostgreSQL
@@ -64,6 +70,18 @@ const storeChangedEvent = (s: string) => {
64
70
default :
65
71
sqlConfig .value .dialect = StandardSQL
66
72
}
73
+
74
+ switch (GetDriverName (e )){
75
+ case Driver .MySQL :
76
+ case Driver .Postgres :
77
+ case Driver .TDengine :
78
+ e .properties .forEach ((p : Pair ) => {
79
+ if (p .key === ' database' ) {
80
+ queryDataMeta .value .currentDatabase = p .value
81
+ }
82
+ })
83
+ break ;
84
+ }
67
85
return
68
86
}
69
87
})
@@ -79,7 +97,6 @@ const storeChangedEvent = (s: string) => {
79
97
complexEditor .value = true
80
98
}
81
99
82
- queryDataMeta .value .currentDatabase = GetDataManagerPreference ().currentDatabase
83
100
executeQuery ()
84
101
}
85
102
watch (store , storeChangedEvent )
You can’t perform that action at this time.
0 commit comments