fix(sqlserver): wrap identity inserts with SET IDENTITY_INSERT
This commit is contained in:
20 files changed
+349
-12
No files matched your search
@@ -140,6 +140,25 @@ describe("query result SQL export progress", () => {
|
||||
expect(api.startQueryResultExport).toHaveBeenCalledWith(expect.objectContaining({ format: "sql", exportTableName: "users", exportColumnTypes: ["int4", "text"] }), expect.any(Function));
|
||||
});
|
||||
|
||||
it("forwards result column EXTRA metadata so identity INSERT exports can be replayed", async () => {
|
||||
const state = useDataGridExport(
|
||||
createOptions({
|
||||
tableMeta: computed(() => ({
|
||||
tableName: "users",
|
||||
primaryKeys: ["id"],
|
||||
columns: [
|
||||
{ name: "id", data_type: "int", is_nullable: false, is_primary_key: true, extra: "identity(1,1)" },
|
||||
{ name: "name", data_type: "text", is_nullable: true },
|
||||
],
|
||||
})),
|
||||
}),
|
||||
);
|
||||
|
||||
await state.exportSql();
|
||||
|
||||
expect(api.startQueryResultExport).toHaveBeenCalledWith(expect.objectContaining({ format: "sql", exportColumnTypes: ["int4", "text"], exportColumnExtras: ["identity(1,1)", null] }), expect.any(Function));
|
||||
});
|
||||
|
||||
it("routes incomplete query-result JSON exports through the streaming backend", async () => {
|
||||
const state = useDataGridExport(createOptions());
|
||||
|
||||
|
||||
Reference in new issue
Block a user