1 parent
8482ef25ec
commit
11d9df0169
9 files changed
+144
-27
No files matched your search
@@ -1388,6 +1388,11 @@ export function useDataGridEditor(options: UseDataGridEditorOptions) {
|
||||
};
|
||||
}
|
||||
|
||||
function saveDriverProfile() {
|
||||
const id = connectionId.value;
|
||||
return id ? connectionStore.getConfig(id)?.driver_profile : undefined;
|
||||
}
|
||||
|
||||
function tableHistoryTarget() {
|
||||
if (!tableMeta.value) return "";
|
||||
return [tableMeta.value.schema, tableMeta.value.tableName].filter(Boolean).join(".");
|
||||
@@ -1514,7 +1519,7 @@ export function useDataGridEditor(options: UseDataGridEditorOptions) {
|
||||
let preparedSave: Awaited<ReturnType<typeof api.prepareDataGridSave>> | undefined;
|
||||
if (stmtOptions) {
|
||||
try {
|
||||
preparedSave = await api.prepareDataGridSave(stmtOptions);
|
||||
preparedSave = await api.prepareDataGridSave(stmtOptions, saveDriverProfile());
|
||||
} catch (e: any) {
|
||||
saveError.value = normalizeDataGridSaveError(databaseType.value, e);
|
||||
await finishInterruptedSaveChanges(snapshot);
|
||||
@@ -1720,7 +1725,7 @@ export function useDataGridEditor(options: UseDataGridEditorOptions) {
|
||||
}
|
||||
const stmtOptions = saveStatementOptions();
|
||||
if (!stmtOptions) return [];
|
||||
const prepared = await api.prepareDataGridSave(stmtOptions);
|
||||
const prepared = await api.prepareDataGridSave(stmtOptions, saveDriverProfile());
|
||||
if (prepared?.validationError) {
|
||||
saveError.value = prepared.validationError;
|
||||
return [];
|
||||
|
||||
@@ -1251,8 +1251,8 @@ export async function analyzeEditableQueryEditability(sql: string): Promise<Quer
|
||||
return post("/api/query/analyze-editability", { sql });
|
||||
}
|
||||
|
||||
export async function prepareDataGridSave(options: DataGridSaveStatementOptions): Promise<DataGridSavePreparation> {
|
||||
return post("/api/query/prepare-data-grid-save", { options });
|
||||
export async function prepareDataGridSave(options: DataGridSaveStatementOptions, driverProfile?: string): Promise<DataGridSavePreparation> {
|
||||
return post("/api/query/prepare-data-grid-save", { options, driverProfile });
|
||||
}
|
||||
|
||||
export async function extractDataGridSelection(request: DataGridExtractRequest): Promise<DataGridExtractResult> {
|
||||
|
||||
@@ -1462,8 +1462,8 @@ export interface DataGridSavePreparation {
|
||||
executionSchema?: string;
|
||||
}
|
||||
|
||||
export async function prepareDataGridSave(options: DataGridSaveStatementOptions): Promise<DataGridSavePreparation> {
|
||||
return invoke("prepare_data_grid_save", { options });
|
||||
export async function prepareDataGridSave(options: DataGridSaveStatementOptions, driverProfile?: string): Promise<DataGridSavePreparation> {
|
||||
return invoke("prepare_data_grid_save", { options, driverProfile });
|
||||
}
|
||||
|
||||
export async function extractDataGridSelection(request: DataGridExtractRequest): Promise<DataGridExtractResult> {
|
||||
|
||||
Reference in new issue
Block a user