fix(editor): preserve view type in object navigation

This commit is contained in:
t8y2 committed 2026-07-14 18:41:26 +08:00
1 parent 39aa506e44
commit 69dd363417
8 files changed
+108 -25

No files matched your search

@@ -0,0 +1,11 @@
import type { ObjectSourceKind } from "@/types/database";
export function tableObjectSourceKind(tableType: string | null | undefined): ObjectSourceKind | undefined {
const normalized = tableType
?.trim()
.toUpperCase()
.replace(/[\s-]+/g, "_");
if (normalized === "VIEW") return "VIEW";
if (normalized === "MATERIALIZED_VIEW") return "MATERIALIZED_VIEW";
return undefined;
}