fix(questdb): handle materialized views and unify table_type naming

* fix(questdb): handle materialized views

* fix(test): fix rust test problems
This commit is contained in:
ptma authored and GitHub committed 2026-06-18 11:40:57 +08:00
1 parent ad0a9075b5
commit e7ee0c9ec1
11 files changed
+112 -56

No files matched your search

+4 -4
View File
@@ -2043,7 +2043,7 @@ export const useConnectionStore = defineStore("connection", () => {
return tables.map((table) => ({
name: table.name,
schema: s,
type: table.table_type === "VIEW" || table.table_type === "MATERIALIZED VIEW" ? ("view" as const) : ("table" as const),
type: table.table_type === "VIEW" || table.table_type === "MATERIALIZED_VIEW" ? ("view" as const) : ("table" as const),
})) as SqlCompletionTable[];
} catch {
return [] as SqlCompletionTable[];
@@ -2065,7 +2065,7 @@ export const useConnectionStore = defineStore("connection", () => {
return tables.map((table) => ({
name: table.name,
schema: s,
type: table.table_type === "VIEW" || table.table_type === "MATERIALIZED VIEW" ? ("view" as const) : ("table" as const),
type: table.table_type === "VIEW" || table.table_type === "MATERIALIZED_VIEW" ? ("view" as const) : ("table" as const),
})) as SqlCompletionTable[];
} catch {
return [] as SqlCompletionTable[];
@@ -2092,7 +2092,7 @@ export const useConnectionStore = defineStore("connection", () => {
return tables.map((table) => ({
name: table.name,
schema,
type: table.table_type === "VIEW" || table.table_type === "MATERIALIZED VIEW" ? ("view" as const) : ("table" as const),
type: table.table_type === "VIEW" || table.table_type === "MATERIALIZED_VIEW" ? ("view" as const) : ("table" as const),
}));
} catch {
return [];
@@ -2111,7 +2111,7 @@ export const useConnectionStore = defineStore("connection", () => {
}
completionTablesCache.value[cacheKey] = tables.map((table) => ({
name: table.name,
type: table.table_type === "VIEW" || table.table_type === "MATERIALIZED VIEW" ? ("view" as const) : ("table" as const),
type: table.table_type === "VIEW" || table.table_type === "MATERIALIZED_VIEW" ? ("view" as const) : ("table" as const),
}));
completionTablesCache.value[cacheKey] = limit ? completionTablesCache.value[cacheKey].slice(0, limit) : completionTablesCache.value[cacheKey];
indexCompletionTables(connectionId, database, schema, completionTablesCache.value[cacheKey]);