fix(dameng): normalize copied table target names

This commit is contained in:
t8y2 committed 2026-08-01 23:43:58 +08:00
1 parent fcedfef63d
commit e33d8acb96
6 files changed
+73 -9

No files matched your search

@@ -2115,6 +2115,7 @@ async function confirmPasteTable() {
schema,
sourceName: entry.sourceName,
targetName,
normalizeNewTargetName: mode === "structure-and-data",
...dataCopyColumnOptions,
});
const executed = await executeObjectBrowserSqlWithProductionGuard(dataSql, () => api.executeQuery(props.connection.id, props.database, dataSql, schema));
@@ -16,5 +16,6 @@ describe("ObjectBrowser cross-database table paste", () => {
expect(objectBrowserSource).toContain("if (canTransferTableClipboard()) {");
expect(objectBrowserSource).toContain("if (!canPasteTableClipboard() && !canTransferTableClipboard()) return;");
expect(objectBrowserSource).toContain("pasteTableMode.value = defaultPasteTableMode(effectiveDatabaseType.value);");
expect(objectBrowserSource).toContain('normalizeNewTargetName: mode === "structure-and-data"');
});
});
@@ -3075,6 +3075,7 @@ async function confirmPasteTable() {
schema: entry.schema,
sourceName: entry.sourceName,
targetName,
normalizeNewTargetName: mode === "structure-and-data",
...dataCopyColumnOptions,
});
const dataExecuted = await executeTreeNodeSqlWithProductionGuard(entry, dataSql, { database: entry.database, schema: entry.schema });
@@ -16,6 +16,7 @@ describe("cross-database table paste", () => {
it("retains the local duplicate-table paste path", () => {
expect(runtimeSource).toContain("if (canTransferTreeClipboardToCurrentNode()) return openTransferFromTreeClipboard();");
expect(runtimeSource).toContain("pasteTableMode.value = defaultPasteTableMode(currentDatabaseType());");
expect(runtimeSource).toContain('normalizeNewTargetName: mode === "structure-and-data"');
});
it("carries table comments through the local sidebar paste path", () => {