fix(schema): handle view DDL object types

This commit is contained in:
t8y2 committed 2026-06-17 19:29:24 +08:00
1 parent 7643148708
commit 22b8ba17bb
14 files changed
+175 -48

No files matched your search

@@ -728,7 +728,7 @@ async function confirmBatchDropTables() {
async function exportStructure(row: ObjectBrowserRow) {
try {
const schema = row.schema || selectedSchema.value || props.database;
const ddl = await api.getTableDdl(props.connection.id, props.database, schema, row.name);
const ddl = await api.getTableDdl(props.connection.id, props.database, schema, row.name, row.type === "VIEW" ? "VIEW" : undefined);
await saveFileContent(ddl + "\n", `${row.name}.sql`, "SQL", "sql");
} catch (e: any) {
console.error("Export structure failed:", e);