feat(transfer): add SQL preview before structure-only transfer
This commit is contained in:
1 parent
1d9223eeed
commit
bf68b93b05
22 files changed
+1332
-54
No files matched your search
@@ -6,7 +6,18 @@ import { Dialog, DialogContent, DialogDescription, DialogHeader, DialogTitle, Di
|
||||
import { Button } from "@/components/ui/button";
|
||||
import { buildTransferObjectSelections, countTransferObjects } from "./transferSelections";
|
||||
import { createTaskLoadTracker } from "./taskLoadTracker";
|
||||
import { confirmTransferWithProductionSafety, createTransferSubmission, rebuildUnavailableReason, resolveTransferStrategy, supportsTransferUpsert, transferStrategyOptions, type TransferStrategy } from "./transferStrategy";
|
||||
import {
|
||||
confirmTransferWithProductionSafety,
|
||||
createTransferSubmission,
|
||||
hasTransferSqlPreview,
|
||||
rebuildUnavailableReason,
|
||||
resolveTransferStrategy,
|
||||
supportsTransferUpsert,
|
||||
transferPreviewSql,
|
||||
transferStrategyOptions,
|
||||
TRANSFER_STRUCTURE_PREVIEW_UNAVAILABLE,
|
||||
type TransferStrategy,
|
||||
} from "./transferStrategy";
|
||||
import { Input } from "@/components/ui/input";
|
||||
import { Label } from "@/components/ui/label";
|
||||
import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from "@/components/ui/select";
|
||||
@@ -181,7 +192,7 @@ const targetTableStrategy = computed<TransferStrategy>({
|
||||
const targetTableNameCase = ref<TransferTableNameCase>("preserve");
|
||||
const quoteTargetColumnNames = ref(true);
|
||||
const batchSize = ref(1000);
|
||||
const showRebuildConfirm = ref(false);
|
||||
const showSqlPreviewConfirm = ref(false);
|
||||
const isSubmitting = ref(false);
|
||||
const pendingTransferId = ref<string | null>(null);
|
||||
const showStartConfirm = ref(false);
|
||||
@@ -812,7 +823,7 @@ async function requestStartTransfer() {
|
||||
await transferSubmission.start(request);
|
||||
} catch (error) {
|
||||
const message = error instanceof Error ? error.message : String(error);
|
||||
toast(message === "TRANSFER_REBUILD_PREVIEW_UNAVAILABLE" ? t("transfer.rebuildPreviewUnavailable") : t("transfer.previewFailed", { message }), 5000);
|
||||
toast(transferPreviewFailureMessage(message), 5000);
|
||||
} finally {
|
||||
if (pendingTransferId.value === request.transferId) {
|
||||
pendingTransferId.value = null;
|
||||
@@ -1069,18 +1080,48 @@ const confirmationSummary = computed(() => {
|
||||
});
|
||||
|
||||
const confirmationStrategy = computed(() => (confirmationRequest.value ? transferStrategyLabel(confirmationRequest.value) : ""));
|
||||
const rebuildConfirmationDetails = computed(() => {
|
||||
const rebuild = confirmationPreview.value?.rebuild;
|
||||
if (!rebuild) return "";
|
||||
const missingTargets = rebuild.tables.some((table) => !table.backupTable);
|
||||
return [confirmationSummary.value, t("transfer.rebuildSummary", { count: rebuild.tables.length }), missingTargets ? t("transfer.rebuildMissingTargets") : ""].filter(Boolean).join("\n");
|
||||
const confirmationTitle = computed(() => {
|
||||
if (!confirmationRequest.value) return "";
|
||||
// A rebuild keeps its strategy title (it covers rename + create); a plain structure transfer
|
||||
// is titled by what the user is actually reviewing.
|
||||
return confirmationRequest.value.dropTargetBeforeCreate ? confirmationStrategy.value : t("transfer.structurePreviewTitle");
|
||||
});
|
||||
/** The read-only SQL both confirmations review, composed so no operation is shown twice. */
|
||||
const confirmationSql = computed(() => (confirmationPreview.value ? transferPreviewSql(confirmationPreview.value) : ""));
|
||||
const confirmationDangerMessage = computed(() => (confirmationRequest.value?.dropTargetBeforeCreate ? t("transfer.rebuildDanger") : t("transfer.structurePreviewDanger")));
|
||||
const confirmationDetails = computed(() => {
|
||||
const preview = confirmationPreview.value;
|
||||
const request = confirmationRequest.value;
|
||||
if (!preview || !request) return "";
|
||||
const lines = [confirmationSummary.value];
|
||||
if (preview.rebuild) {
|
||||
const missingTargets = preview.rebuild.tables.some((table) => !table.backupTable);
|
||||
lines.push(t("transfer.rebuildSummary", { count: preview.rebuild.tables.length }));
|
||||
if (missingTargets) lines.push(t("transfer.rebuildMissingTargets"));
|
||||
}
|
||||
if (preview.structure) {
|
||||
lines.push(t("transfer.structurePreviewSummary", { count: preview.structure.tables.length }));
|
||||
if (preview.structure.tables.some((table) => table.preexisting)) lines.push(t("transfer.structurePreviewPreexistingTargets"));
|
||||
const unexpandedObjects = request.objects.filter((selection) => selection.objectType !== "TABLE" && selection.names.length > 0);
|
||||
if (unexpandedObjects.length > 0) {
|
||||
lines.push(t("transfer.structurePreviewUnexpandedObjects", { objects: unexpandedObjects.map((selection) => selection.names.join(", ")).join("; ") }));
|
||||
}
|
||||
lines.push(t("transfer.structurePreviewRevalidation"));
|
||||
}
|
||||
return lines.filter(Boolean).join("\n");
|
||||
});
|
||||
|
||||
function transferPreviewFailureMessage(message: string): string {
|
||||
if (message === "TRANSFER_REBUILD_PREVIEW_UNAVAILABLE") return t("transfer.rebuildPreviewUnavailable");
|
||||
if (message === TRANSFER_STRUCTURE_PREVIEW_UNAVAILABLE) return t("transfer.structurePreviewUnavailable");
|
||||
return t("transfer.previewFailed", { message });
|
||||
}
|
||||
|
||||
function requestTransferConfirmation(request: api.TransferRequest, preview: api.TransferOwnershipPreview): Promise<boolean> {
|
||||
confirmationRequest.value = request;
|
||||
confirmationPreview.value = preview;
|
||||
const reviewText = preview.rebuild
|
||||
? [confirmationStrategy.value, rebuildConfirmationDetails.value, preview.rebuild.sql].filter(Boolean).join("\n\n")
|
||||
const reviewText = hasTransferSqlPreview(preview)
|
||||
? [confirmationStrategy.value, confirmationDetails.value, transferPreviewSql(preview)].filter(Boolean).join("\n\n")
|
||||
: [confirmationSummary.value, `${t("transfer.targetTableHandling")}: ${confirmationStrategy.value}`, ...request.objects.map((selection) => selection.names.join(", "))].join("\n");
|
||||
return confirmTransferWithProductionSafety({
|
||||
request,
|
||||
@@ -1090,7 +1131,7 @@ function requestTransferConfirmation(request: api.TransferRequest, preview: api.
|
||||
confirm: () =>
|
||||
new Promise((resolve) => {
|
||||
resolveTransferConfirmation = resolve;
|
||||
if (request.dropTargetBeforeCreate) showRebuildConfirm.value = true;
|
||||
if (hasTransferSqlPreview(preview)) showSqlPreviewConfirm.value = true;
|
||||
else showStartConfirm.value = true;
|
||||
}),
|
||||
});
|
||||
@@ -1100,7 +1141,7 @@ function resolveStartDecision(confirmed: boolean) {
|
||||
const resolve = resolveTransferConfirmation;
|
||||
resolveTransferConfirmation = undefined;
|
||||
showStartConfirm.value = false;
|
||||
showRebuildConfirm.value = false;
|
||||
showSqlPreviewConfirm.value = false;
|
||||
resolve?.(confirmed);
|
||||
}
|
||||
|
||||
@@ -1124,7 +1165,7 @@ watch(
|
||||
{ flush: "sync" },
|
||||
);
|
||||
watch(
|
||||
showRebuildConfirm,
|
||||
showSqlPreviewConfirm,
|
||||
(isOpen) => {
|
||||
if (!isOpen) resolveStartDecision(false);
|
||||
},
|
||||
@@ -1460,16 +1501,7 @@ async function saveConfigTask() {
|
||||
</DialogContent>
|
||||
</Dialog>
|
||||
|
||||
<DangerConfirmDialog
|
||||
v-model:open="showRebuildConfirm"
|
||||
:sql="confirmationPreview?.rebuild?.sql"
|
||||
:title="confirmationStrategy"
|
||||
:message="t('transfer.rebuildDanger')"
|
||||
:details-text="rebuildConfirmationDetails"
|
||||
:confirm-label="t('transfer.start')"
|
||||
:close-on-confirm="false"
|
||||
@confirm="resolveStartDecision(true)"
|
||||
/>
|
||||
<DangerConfirmDialog v-model:open="showSqlPreviewConfirm" :sql="confirmationSql" :title="confirmationTitle" :message="confirmationDangerMessage" :details-text="confirmationDetails" :confirm-label="t('transfer.start')" :close-on-confirm="false" @confirm="resolveStartDecision(true)" />
|
||||
|
||||
<Dialog v-model:open="ownershipDialogOpen">
|
||||
<DialogContent class="sm:max-w-[520px]" @interact-outside.prevent>
|
||||
|
||||
+173
@@ -0,0 +1,173 @@
|
||||
import { describe, expect, it, vi } from "vitest";
|
||||
import type { TransferOwnershipPreview, TransferRequest } from "@/lib/backend/api";
|
||||
import { createTransferSubmission, hasTransferSqlPreview, transferPreviewSql, TRANSFER_STRUCTURE_PREVIEW_UNAVAILABLE } from "../transferStrategy";
|
||||
|
||||
function structureRequest(overrides: Partial<TransferRequest> = {}): TransferRequest {
|
||||
return {
|
||||
transferId: "transfer-1",
|
||||
sourceConnectionId: "source",
|
||||
sourceDatabase: "app",
|
||||
sourceSchema: "public",
|
||||
targetConnectionId: "target",
|
||||
targetDatabase: "warehouse",
|
||||
targetSchema: "reporting",
|
||||
tables: ["orders"],
|
||||
objects: [{ objectType: "TABLE", names: ["orders"] }],
|
||||
createTable: true,
|
||||
content: "structureOnly",
|
||||
mode: "append",
|
||||
targetTableNameCase: "preserve",
|
||||
quoteTargetColumnNames: true,
|
||||
ownershipPolicy: "preserve",
|
||||
batchSize: 1000,
|
||||
dropTargetBeforeCreate: false,
|
||||
dropTargetConfirmed: false,
|
||||
...overrides,
|
||||
};
|
||||
}
|
||||
|
||||
function structurePreview(sql = '-- orders -> reporting.orders\nCREATE TABLE "reporting"."orders" ("id" integer);'): TransferOwnershipPreview["structure"] {
|
||||
return { sql, tables: [{ sourceTable: "orders", targetTable: "reporting.orders", preexisting: false, sql }] };
|
||||
}
|
||||
|
||||
function preview(overrides: Partial<TransferOwnershipPreview> = {}): TransferOwnershipPreview {
|
||||
return { missingOwners: [], targetOwner: "", structure: structurePreview(), ...overrides };
|
||||
}
|
||||
|
||||
/** Collects what the submission asked for, so a refused transfer is visible as "no execute". */
|
||||
function submissionHarness(backendPreview: (request: TransferRequest) => Promise<TransferOwnershipPreview>, confirmed = true) {
|
||||
const previews: TransferRequest[] = [];
|
||||
const reviewed: Array<{ request: TransferRequest; preview: TransferOwnershipPreview }> = [];
|
||||
const executions: TransferRequest[] = [];
|
||||
const submission = createTransferSubmission({
|
||||
preview: async (request) => {
|
||||
previews.push(request);
|
||||
return backendPreview(request);
|
||||
},
|
||||
confirmOwnership: async () => "preserve",
|
||||
confirm: async (request, plan) => {
|
||||
reviewed.push({ request, preview: plan });
|
||||
return confirmed;
|
||||
},
|
||||
execute: (request) => {
|
||||
executions.push(request);
|
||||
},
|
||||
});
|
||||
return { submission, previews, reviewed, executions };
|
||||
}
|
||||
|
||||
describe("structure-only SQL preview", () => {
|
||||
it("reviews the planned structure SQL and executes only after confirmation", async () => {
|
||||
const harness = submissionHarness(async () => preview());
|
||||
|
||||
await expect(harness.submission.start(structureRequest())).resolves.toBe(true);
|
||||
|
||||
expect(harness.previews).toHaveLength(1);
|
||||
expect(harness.reviewed[0]?.preview.structure?.sql).toContain("CREATE TABLE");
|
||||
expect(transferPreviewSql(harness.reviewed[0]!.preview)).toContain('CREATE TABLE "reporting"."orders"');
|
||||
expect(hasTransferSqlPreview(harness.reviewed[0]!.preview)).toBe(true);
|
||||
expect(harness.executions).toHaveLength(1);
|
||||
expect(harness.executions[0]?.content).toBe("structureOnly");
|
||||
});
|
||||
|
||||
it("does not execute when the SQL confirmation is cancelled", async () => {
|
||||
const harness = submissionHarness(async () => preview(), false);
|
||||
|
||||
await expect(harness.submission.start(structureRequest())).resolves.toBe(false);
|
||||
|
||||
expect(harness.reviewed).toHaveLength(1);
|
||||
expect(harness.executions).toEqual([]);
|
||||
});
|
||||
|
||||
it("fails closed when the backend returns no structure preview", async () => {
|
||||
const harness = submissionHarness(async () => ({ missingOwners: [], targetOwner: "" }));
|
||||
|
||||
await expect(harness.submission.start(structureRequest())).rejects.toThrow(TRANSFER_STRUCTURE_PREVIEW_UNAVAILABLE);
|
||||
|
||||
expect(harness.reviewed).toEqual([]);
|
||||
expect(harness.executions).toEqual([]);
|
||||
});
|
||||
|
||||
it("places the structure plan between the rebuild rename and cleanup phases without repeating either", () => {
|
||||
const composed = transferPreviewSql({
|
||||
missingOwners: [],
|
||||
targetOwner: "",
|
||||
structure: structurePreview("CREATE TABLE users (id integer);"),
|
||||
rebuild: {
|
||||
sql: "COMBINED PLAN",
|
||||
tables: [{ sourceTable: "users", targetTable: "users", backupTable: "users__dbx_bak_1" }],
|
||||
backupSql: "ALTER TABLE users RENAME TO users__dbx_bak_1;",
|
||||
cleanupSql: "DROP TABLE users__dbx_bak_1;",
|
||||
},
|
||||
});
|
||||
|
||||
expect(composed.split("\n\n")).toEqual(["ALTER TABLE users RENAME TO users__dbx_bak_1;", "CREATE TABLE users (id integer);", "DROP TABLE users__dbx_bak_1;"]);
|
||||
expect(composed).not.toContain("COMBINED PLAN");
|
||||
});
|
||||
|
||||
it("keeps the combined rebuild plan for rebuilds without a structure preview", () => {
|
||||
const composed = transferPreviewSql({
|
||||
missingOwners: [],
|
||||
targetOwner: "",
|
||||
rebuild: {
|
||||
sql: "COMBINED PLAN",
|
||||
tables: [{ sourceTable: "users", targetTable: "users", backupTable: "users__dbx_bak_1" }],
|
||||
},
|
||||
});
|
||||
|
||||
expect(composed).toBe("COMBINED PLAN");
|
||||
expect(hasTransferSqlPreview({ missingOwners: [], targetOwner: "", rebuild: { sql: "PLAN", tables: [] } })).toBe(true);
|
||||
});
|
||||
|
||||
it("does not request a structure preview for data-only transfers", async () => {
|
||||
const harness = submissionHarness(async () => {
|
||||
throw new Error("Data-only must not load the structure preview");
|
||||
});
|
||||
|
||||
await expect(harness.submission.start(structureRequest({ content: "dataOnly", createTable: false }))).resolves.toBe(true);
|
||||
|
||||
expect(harness.previews).toEqual([]);
|
||||
expect(harness.executions).toHaveLength(1);
|
||||
});
|
||||
|
||||
it("keeps structure-and-data transfers on the existing confirmation path", async () => {
|
||||
const harness = submissionHarness(async () => ({ missingOwners: [], targetOwner: "" }));
|
||||
|
||||
await expect(harness.submission.start(structureRequest({ content: "structureAndData", tables: ["orders"] }))).resolves.toBe(true);
|
||||
|
||||
expect(harness.previews).toHaveLength(1);
|
||||
expect(harness.reviewed[0]?.preview.structure).toBeUndefined();
|
||||
expect(hasTransferSqlPreview(harness.reviewed[0]!.preview)).toBe(false);
|
||||
expect(harness.executions).toHaveLength(1);
|
||||
});
|
||||
|
||||
it("still refuses a rebuild that has no rebuild plan", async () => {
|
||||
const harness = submissionHarness(async () => ({ missingOwners: [], targetOwner: "", structure: structurePreview() }));
|
||||
|
||||
await expect(harness.submission.start(structureRequest({ dropTargetBeforeCreate: true }))).rejects.toThrow("TRANSFER_REBUILD_PREVIEW_UNAVAILABLE");
|
||||
|
||||
expect(harness.executions).toEqual([]);
|
||||
});
|
||||
|
||||
it("refuses a structure-only transfer whose preview is missing even when ownership was re-confirmed", async () => {
|
||||
const executions: TransferRequest[] = [];
|
||||
let previewCalls = 0;
|
||||
const confirmations = vi.fn(async () => true);
|
||||
const submission = createTransferSubmission({
|
||||
preview: async () => {
|
||||
previewCalls += 1;
|
||||
return previewCalls === 1 ? { missingOwners: ["old_owner"], targetOwner: "target_user", structure: structurePreview() } : { missingOwners: [], targetOwner: "" };
|
||||
},
|
||||
confirmOwnership: async () => "reassignMissing",
|
||||
confirm: confirmations,
|
||||
execute: (request) => {
|
||||
executions.push(request);
|
||||
},
|
||||
});
|
||||
|
||||
await expect(submission.start(structureRequest())).rejects.toThrow(TRANSFER_STRUCTURE_PREVIEW_UNAVAILABLE);
|
||||
|
||||
expect(confirmations).not.toHaveBeenCalled();
|
||||
expect(executions).toEqual([]);
|
||||
});
|
||||
});
|
||||
@@ -5,6 +5,9 @@ import { useProductionSafetyStore } from "@/stores/productionSafetyStore";
|
||||
|
||||
export type TransferStrategy = TransferMode | "rebuild";
|
||||
|
||||
/** Fail-closed discriminator: a structure-only transfer may not run without its SQL preview. */
|
||||
export const TRANSFER_STRUCTURE_PREVIEW_UNAVAILABLE = "TRANSFER_STRUCTURE_PREVIEW_UNAVAILABLE";
|
||||
|
||||
export function resolveTransferStrategy(options: { mode?: TransferMode; dropTargetBeforeCreate?: boolean }): TransferStrategy {
|
||||
return options.dropTargetBeforeCreate ? "rebuild" : (options.mode ?? "append");
|
||||
}
|
||||
@@ -42,6 +45,26 @@ function freezeTransferRequest(request: TransferRequest): TransferRequest {
|
||||
return Object.freeze(snapshot);
|
||||
}
|
||||
|
||||
/**
|
||||
* The SQL document a SQL-preview confirmation shows and reviews.
|
||||
*
|
||||
* A rebuild is composed around the structure plan so each operation appears exactly once and
|
||||
* in execution order — rename the old target aside, create the new structure, drop the
|
||||
* backups after success. Without a rebuild (or without a structure plan) it is just the
|
||||
* structure SQL, and a backend that only reports the combined rebuild plan keeps its
|
||||
* existing `rebuild.sql`.
|
||||
*/
|
||||
export function transferPreviewSql(preview: TransferOwnershipPreview): string {
|
||||
const sections = [preview.rebuild?.backupSql, preview.structure?.sql, preview.rebuild?.cleanupSql].filter((section): section is string => Boolean(section));
|
||||
if (sections.length > 0) return sections.join("\n\n");
|
||||
return preview.rebuild?.sql ?? "";
|
||||
}
|
||||
|
||||
/** Whether this preview has SQL the user must review in a read-only confirmation. */
|
||||
export function hasTransferSqlPreview(preview: TransferOwnershipPreview): boolean {
|
||||
return Boolean(preview.rebuild || preview.structure);
|
||||
}
|
||||
|
||||
interface TransferSubmissionOptions {
|
||||
ensureWritable?: (request: TransferRequest) => Promise<boolean>;
|
||||
preview: (request: TransferRequest) => Promise<TransferOwnershipPreview>;
|
||||
@@ -75,6 +98,9 @@ export function createTransferSubmission(options: TransferSubmissionOptions) {
|
||||
}
|
||||
}
|
||||
if (request.dropTargetBeforeCreate && !preview.rebuild) throw new Error("TRANSFER_REBUILD_PREVIEW_UNAVAILABLE");
|
||||
// A structure-only transfer changes the target schema; never fall back to the plain
|
||||
// start confirmation when the backend did not say what it is going to run.
|
||||
if (request.content === "structureOnly" && !preview.structure) throw new Error(TRANSFER_STRUCTURE_PREVIEW_UNAVAILABLE);
|
||||
if (!(await options.confirm(request, preview)) || !isCurrent()) return false;
|
||||
options.execute(Object.freeze({ ...request, dropTargetConfirmed: request.dropTargetBeforeCreate }));
|
||||
return true;
|
||||
|
||||
@@ -5995,6 +5995,13 @@ export default withEnglishFallback({
|
||||
rebuildDataOnlyDisabled: "Yalnız məlumat köçürmələri üçün yenidən qurma əlçatan deyil. Struktur və məlumatları və ya yalnız strukturu seçin.",
|
||||
rebuildUnsupportedDisabled: "Seçilmiş hədəf mühərriki hədəf cədvəllərin yenidən qurulmasını dəstəkləmir.",
|
||||
rebuildPreviewUnavailable: "Server tərəfi yenidən qurma planını təqdim etmədi. Köçürmə başlamayıb; yenidən qurmanı dəstəkləyən server tərəfi ilə önbaxışı yeniləyin.",
|
||||
structurePreviewTitle: "Struktur SQL önbaxışı",
|
||||
structurePreviewDanger: "Bunlar köçürmənin hədəfdə icra edəcəyi struktur ifadələridir və yalnız oxumaq üçün göstərilir. Köçürmə başlayarkən DBX cari hədəf strukturunu yenidən yoxlayır, ona görə bu arada dəyişən hədəf son icra olunan ifadələri dəyişə bilər.",
|
||||
structurePreviewSummary: "{count} cədvəlin strukturu yaradılacaq və ya yenilənəcək.",
|
||||
structurePreviewPreexistingTargets: "Bəzi hədəf cədvəlləri artıq mövcuddur: cari icra davranışı ilə eyni şəkildə DBX onlar üçün struktur DDL icra etmir.",
|
||||
structurePreviewUnexpandedObjects: "Seçilmiş cədvəldən başqa obyektlər ({objects}) icra zamanı köçürülür; onların yaradılan DDL-i bu önbaxışda göstərilmir.",
|
||||
structurePreviewRevalidation: "Yalnız önbaxış: icradan əvvəl DBX cari hədəf strukturunu yenidən yoxlayır.",
|
||||
structurePreviewUnavailable: "Server tərəfi struktur SQL önbaxışını təqdim etmədi. Köçürmə başlamayıb; struktur önbaxışını dəstəkləyən server tərəfi ilə yenidən cəhd edin.",
|
||||
previewFailed: "Köçürməni hazırlamaq mümkün olmadı: {message}",
|
||||
start: "Köçürməni başlat",
|
||||
startConfirmTitle: "Köçürməni təsdiqlə",
|
||||
|
||||
@@ -6764,6 +6764,13 @@ export default {
|
||||
rebuildUnsupportedDisabled: "The selected target engine does not support rebuilding target tables.",
|
||||
rebuildPreviewUnavailable: "The backend did not provide a rebuild plan. The transfer has not started; refresh the preview with a backend that supports rebuild.",
|
||||
rebuildMissingTargets: "Some target tables do not exist yet and will be created without a backup.",
|
||||
structurePreviewTitle: "Structure SQL preview",
|
||||
structurePreviewDanger: "These are the structure statements this transfer is about to run on the target, shown read-only. DBX re-checks the current target structure when the transfer starts, so a target that changed in the meantime can change what finally runs.",
|
||||
structurePreviewSummary: "Structure will be created or updated for {count} table(s).",
|
||||
structurePreviewPreexistingTargets: "Some target tables already exist: DBX runs no structure DDL for them, matching how the transfer executes today.",
|
||||
structurePreviewUnexpandedObjects: "Selected non-table objects ({objects}) are transferred during execution; their generated DDL is not expanded in this preview.",
|
||||
structurePreviewRevalidation: "Preview only: DBX re-validates the current target structure before executing.",
|
||||
structurePreviewUnavailable: "The backend did not provide a structure SQL preview. The transfer has not started; refresh the preview with a backend that supports structure previews.",
|
||||
previewFailed: "Could not prepare the transfer: {message}",
|
||||
start: "Start Transfer",
|
||||
startConfirmTitle: "Confirm transfer",
|
||||
|
||||
@@ -6171,6 +6171,14 @@ export default withEnglishFallback({
|
||||
rebuildUnsupportedDisabled: "El motor de destino seleccionado no permite reconstruir las tablas de destino.",
|
||||
rebuildPreviewUnavailable: "El backend no devolvió un plan de reconstrucción. La transferencia no se ha iniciado; vuelva a obtener la vista previa con un backend compatible.",
|
||||
rebuildMissingTargets: "Algunas tablas de destino aún no existen y se crearán sin copia de seguridad.",
|
||||
structurePreviewTitle: "Vista previa del SQL de estructura",
|
||||
structurePreviewDanger:
|
||||
"Estas son las sentencias de estructura que la transferencia ejecutará en el destino, mostradas solo para lectura. DBX vuelve a comprobar la estructura del destino al iniciar la transferencia, así que un destino que cambie mientras tanto puede cambiar lo que finalmente se ejecuta.",
|
||||
structurePreviewSummary: "Se creará o actualizará la estructura de {count} tabla(s).",
|
||||
structurePreviewPreexistingTargets: "Algunas tablas de destino ya existen: DBX no ejecuta DDL de estructura para ellas, igual que en la ejecución actual.",
|
||||
structurePreviewUnexpandedObjects: "Los objetos seleccionados que no son tablas ({objects}) se transfieren durante la ejecución; su DDL generado no se detalla en esta vista previa.",
|
||||
structurePreviewRevalidation: "Solo vista previa: DBX vuelve a validar la estructura actual del destino antes de ejecutar.",
|
||||
structurePreviewUnavailable: "El backend no devolvió una vista previa del SQL de estructura. La transferencia no se ha iniciado; vuelva a obtener la vista previa con un backend compatible.",
|
||||
previewFailed: "No se pudo preparar la transferencia: {message}",
|
||||
start: "Iniciar transferencia",
|
||||
startConfirmTitle: "Confirmar transferencia",
|
||||
|
||||
@@ -6578,6 +6578,13 @@ export default withEnglishFallback({
|
||||
rebuildUnsupportedDisabled: "Engine target yang dipilih tidak mendukung pembangunan ulang tabel target.",
|
||||
rebuildPreviewUnavailable: "Backend tidak menyediakan rencana pembangunan ulang. Transfer belum dimulai; segarkan pratinjau dengan backend yang mendukung pembangunan ulang.",
|
||||
rebuildMissingTargets: "Beberapa tabel target belum ada dan akan dibuat tanpa cadangan.",
|
||||
structurePreviewTitle: "Pratinjau SQL struktur",
|
||||
structurePreviewDanger: "Ini adalah pernyataan struktur yang akan dijalankan transfer ini pada target, ditampilkan hanya untuk dibaca. DBX memeriksa ulang struktur target saat transfer dimulai, jadi target yang berubah di sela itu dapat mengubah pernyataan yang akhirnya dijalankan.",
|
||||
structurePreviewSummary: "Struktur akan dibuat atau diperbarui untuk {count} tabel.",
|
||||
structurePreviewPreexistingTargets: "Beberapa tabel target sudah ada: sama seperti perilaku eksekusi saat ini, DBX tidak menjalankan DDL struktur untuk tabel tersebut.",
|
||||
structurePreviewUnexpandedObjects: "Objek terpilih selain tabel ({objects}) ditransfer saat eksekusi; DDL yang dihasilkan tidak dijabarkan di pratinjau ini.",
|
||||
structurePreviewRevalidation: "Hanya pratinjau: DBX memvalidasi ulang struktur target saat ini sebelum menjalankan.",
|
||||
structurePreviewUnavailable: "Backend tidak menyediakan pratinjau SQL struktur. Transfer belum dimulai; segarkan pratinjau dengan backend yang mendukung pratinjau struktur.",
|
||||
previewFailed: "Tidak dapat menyiapkan transfer: {message}",
|
||||
start: "Mulai Transfer",
|
||||
startConfirmTitle: "Konfirmasi transfer",
|
||||
|
||||
@@ -5987,6 +5987,14 @@ export default withEnglishFallback({
|
||||
rebuildUnsupportedDisabled: "Il motore di destinazione selezionato non supporta la ricostruzione delle tabelle di destinazione.",
|
||||
rebuildPreviewUnavailable: "Il backend non ha restituito un piano di ricostruzione. Il trasferimento non è iniziato; aggiornare l’anteprima con un backend compatibile.",
|
||||
rebuildMissingTargets: "Alcune tabelle di destinazione non esistono ancora e verranno create senza backup.",
|
||||
structurePreviewTitle: "Anteprima SQL della struttura",
|
||||
structurePreviewDanger:
|
||||
"Queste sono le istruzioni di struttura che il trasferimento eseguirà sulla destinazione, mostrate in sola lettura. DBX ricontrolla la struttura di destinazione all'avvio del trasferimento, quindi una destinazione modificata nel frattempo può cambiare ciò che viene effettivamente eseguito.",
|
||||
structurePreviewSummary: "La struttura verrà creata o aggiornata per {count} tabelle.",
|
||||
structurePreviewPreexistingTargets: "Alcune tabelle di destinazione esistono già: DBX non esegue DDL di struttura per esse, come nell'esecuzione attuale.",
|
||||
structurePreviewUnexpandedObjects: "Gli oggetti selezionati diversi dalle tabelle ({objects}) vengono trasferiti durante l'esecuzione; il DDL generato non è riportato in questa anteprima.",
|
||||
structurePreviewRevalidation: "Solo anteprima: DBX rivalida la struttura di destinazione attuale prima di eseguire.",
|
||||
structurePreviewUnavailable: "Il backend non ha restituito un'anteprima SQL della struttura. Il trasferimento non è iniziato; ripetere l'anteprima con un backend compatibile.",
|
||||
previewFailed: "Impossibile preparare il trasferimento: {message}",
|
||||
start: "Avvia Trasferimento",
|
||||
startConfirmTitle: "Conferma trasferimento",
|
||||
|
||||
@@ -6009,6 +6009,13 @@ export default withEnglishFallback({
|
||||
rebuildUnsupportedDisabled: "選択したターゲットエンジンはテーブルの再構築をサポートしていません。",
|
||||
rebuildPreviewUnavailable: "バックエンドから再構築計画が返されなかったため、転送は開始されていません。再構築プレビューに対応したバックエンドで再試行してください。",
|
||||
rebuildMissingTargets: "存在しないターゲットテーブルがあります。バックアップなしで直接作成されます。",
|
||||
structurePreviewTitle: "構造 SQL プレビュー",
|
||||
structurePreviewDanger: "これは今回の転送でターゲットに対して実行される構造ステートメントの読み取り専用プレビューです。転送開始時に DBX が現在のターゲット構造を再確認するため、その間にターゲットが変更された場合は実際に実行されるステートメントが変わる可能性があります。",
|
||||
structurePreviewSummary: "{count} 件のテーブルの構造を作成または更新します。",
|
||||
structurePreviewPreexistingTargets: "一部のターゲットテーブルは既に存在します。現在の実行動作と同じく、DBX はそれらの構造 DDL を実行しません。",
|
||||
structurePreviewUnexpandedObjects: "選択された非テーブルオブジェクト({objects})は実行時に転送されますが、生成される DDL はこのプレビューでは展開されません。",
|
||||
structurePreviewRevalidation: "プレビューのみ:実行前に DBX が現在のターゲット構造を再検証します。",
|
||||
structurePreviewUnavailable: "バックエンドから構造 SQL プレビューが返らなかったため、転送は開始されていません。構造プレビューに対応したバックエンドで再試行してください。",
|
||||
previewFailed: "転送を準備できませんでした:{message}",
|
||||
start: "転送開始",
|
||||
startConfirmTitle: "転送の開始確認",
|
||||
|
||||
@@ -5742,6 +5742,13 @@ export default withEnglishFallback({
|
||||
rebuildUnsupportedDisabled: "선택한 대상 엔진은 대상 테이블 재구축을 지원하지 않습니다.",
|
||||
rebuildPreviewUnavailable: "백엔드가 재구축 계획을 반환하지 않아 전송을 시작하지 않았습니다. 재구축 미리 보기를 지원하는 백엔드에서 다시 시도하세요.",
|
||||
rebuildMissingTargets: "존재하지 않는 대상 테이블이 있습니다. 백업 없이 바로 생성됩니다.",
|
||||
structurePreviewTitle: "구조 SQL 미리 보기",
|
||||
structurePreviewDanger: "이것은 이번 전송이 대상에 실행할 구조 문의 읽기 전용 미리 보기입니다. 전송을 시작할 때 DBX가 현재 대상 구조를 다시 확인하므로, 그 사이 대상이 변경되면 실제 실행되는 문이 달라질 수 있습니다.",
|
||||
structurePreviewSummary: "{count}개 테이블의 구조를 만들거나 갱신합니다.",
|
||||
structurePreviewPreexistingTargets: "일부 대상 테이블이 이미 있습니다. 현재 실행 동작과 동일하게 DBX는 해당 테이블의 구조 DDL을 실행하지 않습니다.",
|
||||
structurePreviewUnexpandedObjects: "선택한 비테이블 개체({objects})는 실행 단계에서 전송되며, 생성되는 DDL은 이 미리 보기에 표시되지 않습니다.",
|
||||
structurePreviewRevalidation: "미리 보기 전용: 실행 전에 DBX가 현재 대상 구조를 다시 검증합니다.",
|
||||
structurePreviewUnavailable: "백엔드가 구조 SQL 미리 보기를 반환하지 않아 전송을 시작하지 않았습니다. 구조 미리 보기를 지원하는 백엔드에서 다시 시도하세요.",
|
||||
previewFailed: "전송을 준비할 수 없습니다: {message}",
|
||||
start: "이전 시작",
|
||||
startConfirmTitle: "전송 시작 확인",
|
||||
|
||||
@@ -5989,6 +5989,13 @@ export default withEnglishFallback({
|
||||
rebuildUnsupportedDisabled: "O mecanismo de destino selecionado não oferece suporte à reconstrução das tabelas de destino.",
|
||||
rebuildPreviewUnavailable: "O backend não retornou um plano de reconstrução. A transferência não foi iniciada; atualize a prévia com um backend compatível.",
|
||||
rebuildMissingTargets: "Algumas tabelas de destino ainda não existem e serão criadas sem backup.",
|
||||
structurePreviewTitle: "Prévia do SQL de estrutura",
|
||||
structurePreviewDanger: "Estas são as instruções de estrutura que a transferência executará no destino, exibidas somente para leitura. O DBX revalida a estrutura de destino ao iniciar a transferência, então um destino alterado nesse intervalo pode mudar o que será executado.",
|
||||
structurePreviewSummary: "A estrutura será criada ou atualizada em {count} tabela(s).",
|
||||
structurePreviewPreexistingTargets: "Algumas tabelas de destino já existem: o DBX não executa DDL de estrutura para elas, igual à execução atual.",
|
||||
structurePreviewUnexpandedObjects: "Os objetos selecionados que não são tabelas ({objects}) são transferidos durante a execução; o DDL gerado não é detalhado nesta prévia.",
|
||||
structurePreviewRevalidation: "Apenas prévia: o DBX revalida a estrutura atual do destino antes de executar.",
|
||||
structurePreviewUnavailable: "O backend não retornou uma prévia do SQL de estrutura. A transferência não foi iniciada; atualize a prévia com um backend compatível.",
|
||||
previewFailed: "Não foi possível preparar a transferência: {message}",
|
||||
start: "Iniciar transferência",
|
||||
startConfirmTitle: "Confirmar transferência",
|
||||
|
||||
@@ -7131,6 +7131,13 @@ export default withEnglishFallback({
|
||||
rebuildUnsupportedDisabled: "Выбранный целевой движок не поддерживает перестроение целевых таблиц.",
|
||||
rebuildPreviewUnavailable: "Серверная часть не предоставила план перестроения. Перенос не начат; обновите предпросмотр на серверной части с поддержкой перестроения.",
|
||||
rebuildMissingTargets: "Некоторые целевые таблицы ещё не существуют и будут созданы без резервной копии.",
|
||||
structurePreviewTitle: "Предпросмотр SQL структуры",
|
||||
structurePreviewDanger: "Это доступные только для чтения структурные операторы, которые перенос выполнит на цели. При запуске переноса DBX заново проверяет текущую структуру целевой базы, поэтому изменённая за это время цель может привести к другим фактическим операторам.",
|
||||
structurePreviewSummary: "Структура будет создана или обновлена для таблиц: {count}.",
|
||||
structurePreviewPreexistingTargets: "Некоторые целевые таблицы уже существуют: как и при текущем выполнении, DBX не выполняет для них структурный DDL.",
|
||||
structurePreviewUnexpandedObjects: "Выбранные объекты, не являющиеся таблицами ({objects}), переносятся во время выполнения; их DDL не раскрывается в этом предпросмотре.",
|
||||
structurePreviewRevalidation: "Только предпросмотр: перед выполнением DBX повторно проверяет текущую структуру цели.",
|
||||
structurePreviewUnavailable: "Серверная часть не вернула предпросмотр SQL структуры. Перенос не начат; повторите предпросмотр на серверной части с поддержкой структуры.",
|
||||
previewFailed: "Не удалось подготовить перенос: {message}",
|
||||
start: "Начать перенос",
|
||||
startConfirmTitle: "Подтвердите перенос",
|
||||
|
||||
@@ -5910,6 +5910,13 @@ export default withEnglishFallback({
|
||||
ownershipSkipDetails: "Atla seçeneği, nesne sahipliği değiştirme ifadelerini çalıştırmaz. Tablo verisi ve diğer yapı eşitlemesi devam eder.",
|
||||
ownershipTargetOwner: "Onayla seçeneği, sahibi eksik nesneleri hedef bağlantı kullanıcısına atar: {owner}.",
|
||||
ownershipSkip: "Atla",
|
||||
structurePreviewTitle: "Yapı SQL önizlemesi",
|
||||
structurePreviewDanger: "Bunlar bu aktarımın hedefte çalıştıracağı yapı ifadeleridir ve yalnızca okunmak üzere gösterilir. Aktarım başlarken DBX güncel hedef yapısını yeniden denetler; bu arada değişen bir hedef, sonunda çalışan ifadeleri değiştirebilir.",
|
||||
structurePreviewSummary: "{count} tablonun yapısı oluşturulacak veya güncellenecek.",
|
||||
structurePreviewPreexistingTargets: "Bazı hedef tablolar zaten var: mevcut çalıştırma davranışıyla aynı şekilde DBX onlar için yapı DDL çalıştırmaz.",
|
||||
structurePreviewUnexpandedObjects: "Seçilen tablo dışı nesneler ({objects}) aktarım sırasında taşınır; üretilen DDL bu önizlemede açılmaz.",
|
||||
structurePreviewRevalidation: "Yalnızca önizleme: DBX çalıştırmadan önce güncel hedef yapısını yeniden doğrular.",
|
||||
structurePreviewUnavailable: "Sunucu tarafı yapı SQL önizlemesini sağlamadı. Aktarım başlatılmadı; önizlemeyi yapı önizlemesini destekleyen bir sunucu tarafıyla yenileyin.",
|
||||
ownershipConfirm: "Onayla",
|
||||
selectConnection: "Bağlantı seç",
|
||||
selectDatabase: "Veritabanı seç",
|
||||
|
||||
@@ -6750,6 +6750,13 @@ export default withEnglishFallback({
|
||||
rebuildUnsupportedDisabled: "当前目标引擎不支持重建目标表。",
|
||||
rebuildPreviewUnavailable: "后端未返回重建计划,传输尚未开始。请使用支持重建预览的后端后重新预览。",
|
||||
rebuildMissingTargets: "部分目标表尚不存在,将直接创建(无备份)。",
|
||||
structurePreviewTitle: "结构 SQL 预览",
|
||||
structurePreviewDanger: "以下是本次传输即将在目标端执行的结构语句,仅只读展示。开始传输时 DBX 会重新检查当前目标结构,若目标在此期间发生变化,最终执行的语句可能与预览不同。",
|
||||
structurePreviewSummary: "将为 {count} 张表创建或更新结构。",
|
||||
structurePreviewPreexistingTargets: "部分目标表已存在:与当前执行行为一致,DBX 不会为其执行结构 DDL。",
|
||||
structurePreviewUnexpandedObjects: "所选的非表对象({objects})会在执行阶段传输,其生成的 DDL 未在本预览中展开。",
|
||||
structurePreviewRevalidation: "仅为预览:执行前 DBX 会重新校验当前目标结构。",
|
||||
structurePreviewUnavailable: "后端未返回结构 SQL 预览,传输尚未开始。请使用支持结构预览的后端后重新预览。",
|
||||
previewFailed: "无法准备传输:{message}",
|
||||
start: "开始传输",
|
||||
startConfirmTitle: "确认开始传输",
|
||||
|
||||
@@ -5319,6 +5319,13 @@ export default withEnglishFallback({
|
||||
rebuildUnsupportedDisabled: "目前目標引擎不支援重建目標表。",
|
||||
rebuildPreviewUnavailable: "後端未傳回重建計畫,傳輸尚未開始。請使用支援重建預覽的後端後重新預覽。",
|
||||
rebuildMissingTargets: "部分目標資料表尚不存在,將直接建立(無備份)。",
|
||||
structurePreviewTitle: "結構 SQL 預覽",
|
||||
structurePreviewDanger: "以下是本次傳輸即將在目標端執行的結構語句,僅供唯讀檢視。開始傳輸時 DBX 會重新檢查目前的目標結構;若目標在這段期間發生變化,最終執行的語句可能與預覽不同。",
|
||||
structurePreviewSummary: "將為 {count} 個資料表建立或更新結構。",
|
||||
structurePreviewPreexistingTargets: "部分目標資料表已存在:與目前執行行為一致,DBX 不會為其執行結構 DDL。",
|
||||
structurePreviewUnexpandedObjects: "所選的非資料表物件({objects})會在執行階段傳輸,其產生的 DDL 未在此預覽中展開。",
|
||||
structurePreviewRevalidation: "僅為預覽:執行前 DBX 會重新驗証目前的目標結構。",
|
||||
structurePreviewUnavailable: "後端未傳回結構 SQL 預覽,傳輸尚未開始。請使用支援結構預覽的後端後重新預覽。",
|
||||
previewFailed: "無法準備傳輸:{message}",
|
||||
start: "開始傳輸",
|
||||
startConfirmTitle: "確認開始傳輸",
|
||||
|
||||
@@ -5450,13 +5450,32 @@ export interface TransferRequest {
|
||||
dropTargetConfirmed: boolean;
|
||||
}
|
||||
|
||||
export interface TransferStructurePreviewTable {
|
||||
sourceTable: string;
|
||||
targetTable: string;
|
||||
/** The target table already exists, so this transfer plans no structure DDL for it. */
|
||||
preexisting: boolean;
|
||||
sql: string;
|
||||
}
|
||||
|
||||
export interface TransferStructurePreview {
|
||||
sql: string;
|
||||
tables: TransferStructurePreviewTable[];
|
||||
}
|
||||
|
||||
export interface TransferOwnershipPreview {
|
||||
missingOwners: string[];
|
||||
targetOwner: string;
|
||||
rebuild?: {
|
||||
sql: string;
|
||||
tables: Array<{ sourceTable: string; targetTable: string; backupTable?: string }>;
|
||||
/** The rename phase on its own, so the structure plan can sit between rename and cleanup. */
|
||||
backupSql?: string;
|
||||
/** The drop-backups phase on its own. */
|
||||
cleanupSql?: string;
|
||||
};
|
||||
/** Structure-plan preview: present for structure-only transfers. */
|
||||
structure?: TransferStructurePreview;
|
||||
}
|
||||
|
||||
export interface TransferProgress {
|
||||
|
||||
Reference in new issue
Block a user