feat(export): add portable standard SQL inserts

Closes #9869
This commit is contained in:
t8y2 committed 2026-09-27 15:56:52 +00:00
1 parent ba3872abef
commit 1d07cb05e0
22 files changed
+384 -83

No files matched your search

@@ -540,4 +540,35 @@ describe("useSidebarTreeExportRuntime", () => {
expect(apiMock.startTableExport).toHaveBeenCalledOnce();
expect(apiMock.startTableExport).toHaveBeenCalledWith(expect.objectContaining({ tableName: "users", filePath: "users.csv" }), expect.any(Function));
});
it.each([
["source", undefined],
["standard", "standard"],
] as const)("serializes the %s SQL INSERT dialect for a table export", async (expectedDialect, requestedDialect) => {
const activeNode = shallowRef({ id: "table-1", type: "table", label: "users", connectionId: "conn-1", database: "db", schema: "dbo", children: [] } as TreeNode);
const connectionStore = {
ensureConnected: vi.fn(),
getConfig: vi.fn(() => ({ db_type: "sqlserver" })),
connectionIdentifierQuote: vi.fn(() => "["),
treeNodes: [],
selectedTreeNodeIds: [],
};
const runtime = useSidebarTreeExportRuntime({
activeNode,
connectionStore: connectionStore as never,
settingsStore: exportSettings() as never,
acceptedSelectionIds: () => null,
});
await runtime.exportData("sql", requestedDialect);
expect(apiMock.startTableExport).toHaveBeenCalledWith(
expect.objectContaining({
format: "sql",
insertDialect: expectedDialect,
identifierQuote: "[",
}),
expect.any(Function),
);
});
});