未验证 提交 37e9b809 编写于 作者: M Maciej Bodek 提交者: GitHub

feat(ui): reload table list on schema changes (#1425)

上级 ce504bd0
......@@ -36,6 +36,7 @@ export enum BusEvent {
MSG_QUERY_FIND_N_EXEC = "query.build.execute",
MSG_QUERY_OK = "query.out.ok",
MSG_QUERY_RUNNING = "query.out.running",
MSQ_QUERY_SCHEMA = "query.out.schema",
REACT_READY = "react.ready",
}
......
import $ from "jquery"
import * as qdb from "./globals"
import { BusEvent } from "../../consts";
function s4() {
return (((1 + Math.random()) * 0x10000) | 0).toString(16).substring(1)
......@@ -342,6 +343,7 @@ $.fn.importManager = function (editorBus) {
"s</span>",
true,
)
window.bus.trigger(BusEvent.MSQ_QUERY_SCHEMA)
} else {
current.importState = 4
current.response = data.status
......
......@@ -149,6 +149,7 @@ const Ace = () => {
),
}),
)
bus.trigger(BusEvent.MSQ_QUERY_SCHEMA)
}
if (result.type === QuestDB.Type.DQL) {
......
......@@ -53,6 +53,7 @@ import { color } from "utils"
import * as QuestDB from "utils/questdb"
import Table from "./Table"
import { BusEvent } from "../../consts"
type Props = Readonly<{
hideMenu?: boolean
......@@ -133,6 +134,10 @@ const Schema = ({
useEffect(() => {
void fetchTables()
window.bus.on(BusEvent.MSQ_QUERY_SCHEMA, () => {
void fetchTables()
})
}, [fetchTables])
return (
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册