Skip to content

Commit 44326b3

Browse files
authored
Merge pull request #22 from actiontech/feature/sqle-ee-issue-2636
feat: support sqle ee issue 2636
2 parents d2588ae + 9499b41 commit 44326b3

File tree

4 files changed

+24
-3
lines changed

4 files changed

+24
-3
lines changed

webapp/packages/core-localization/src/locales/en.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ export default [
1414
['ui_processing_cancel', 'Cancel'],
1515
['ui_processing_canceling', 'Cancelling...'],
1616
['ui_create_workflow', 'Create Workflow'],
17+
['ui_still_execute', 'Execute Anyway'],
1718
['ui_workflow_detail', 'Workflow Detail'],
1819
['ui_processing_canceled', 'Canceled'],
1920
['ui_processing_reload', 'Reload'],

webapp/packages/core-localization/src/locales/zh.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ export default [
1313
['ui_processing_loading', '加载中...'],
1414
['ui_processing_cancel', '取消'],
1515
['ui_create_workflow', '发起变更工单'],
16+
['ui_still_execute', '仍要执行'],
1617
['ui_workflow_detail', '工单详情'],
1718
['ui_processing_canceling', '取消中...'],
1819
['ui_processing_canceled', '已取消'],

webapp/packages/plugin-data-viewer/src/TableViewer/TableError.tsx

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ import { ConnectionSchemaManagerService } from '@cloudbeaver/plugin-datasource-c
2222
import { NavigationTabsService } from '@cloudbeaver/plugin-navigation-tabs';
2323
import { ConnectionInfoResource, createConnectionParam } from '@cloudbeaver/core-connections';
2424
import { CommonDialogService, DialogueStateResult } from '@cloudbeaver/core-dialogs';
25-
import { LocalStorageSqlDataSource, SqlDataSourceService } from '@cloudbeaver/plugin-sql-editor';
25+
import { LocalStorageSqlDataSource, QueryDataSource, SqlDataSourceService } from '@cloudbeaver/plugin-sql-editor';
2626
import { isSQLEditorTab, SqlEditorNavigatorService } from '@cloudbeaver/plugin-sql-editor-navigation-tab';
2727
import { SqlEditorSessionClosedDialog } from './SqlEditorSessionClosedDialog.js';
2828

@@ -161,6 +161,10 @@ export const TableError = observer<Props>(function TableError({ model, loading,
161161
}
162162
}, [navigationTabsService, sqlDataSourceService, commonDialogService, connectionInfo, sqlEditorNavigatorService]);
163163

164+
const onStillExecute = useCallback(async () => {
165+
await (model.source as unknown as QueryDataSource).requestWithExecuteAnyway();
166+
}, [model]);
167+
164168
useEffect(() => {
165169
const SQL_CONTEXT_ERROR_CODE = '508';
166170
if (errorInfo.error !== model.source.error) {
@@ -209,7 +213,6 @@ export const TableError = observer<Props>(function TableError({ model, loading,
209213
<Button className={s(style, { button: true })} type="button" onClick={onRetry}>
210214
{translate('ui_processing_retry')}
211215
</Button>
212-
213216
{error.workflowId ? (
214217
<Button className={s(style, { button: true })} type="button" onClick={() => onWorkflowDetailNavigate(error.workflowId!)}>
215218
{translate('ui_workflow_detail')}
@@ -219,6 +222,9 @@ export const TableError = observer<Props>(function TableError({ model, loading,
219222
{translate('ui_create_workflow')}
220223
</Button>
221224
)}
225+
<Button className={s(style, { button: true })} type="button" onClick={onStillExecute}>
226+
{translate('ui_still_execute')}
227+
</Button>
222228
</div>
223229
</div>
224230
);

webapp/packages/plugin-sql-editor/src/QueryDataSource.ts

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,8 @@ export interface IQueryRequestInfo extends IRequestInfo {
4141
export class QueryDataSource<TOptions extends IDataQueryOptions = IDataQueryOptions> extends ResultSetDataSource<TOptions> {
4242
currentTask: ITask<SqlExecuteInfo> | null;
4343
override requestInfo: IQueryRequestInfo;
44+
/** When true, passes isExecuteAnyway to the API for re-execution despite previous errors */
45+
executeAnyway = false;
4446

4547
override get canCancel(): boolean {
4648
return this.currentTask?.cancellable || false;
@@ -175,6 +177,16 @@ export class QueryDataSource<TOptions extends IDataQueryOptions = IDataQueryOpti
175177
return this;
176178
}
177179

180+
/** Re-execute SQL with isExecuteAnyway=true, bypassing error state */
181+
async requestWithExecuteAnyway(): Promise<void> {
182+
this.executeAnyway = true;
183+
try {
184+
await this.requestData();
185+
} finally {
186+
this.executeAnyway = false;
187+
}
188+
}
189+
178190
async request(prevResults: IDatabaseResultSet[]): Promise<IDatabaseResultSet[]> {
179191
const options = this.options;
180192
const executionContext = this.executionContext;
@@ -241,7 +253,8 @@ export class QueryDataSource<TOptions extends IDataQueryOptions = IDataQueryOpti
241253
},
242254
dataFormat: this.dataFormat,
243255
readLogs: options.readLogs,
244-
});
256+
isExecuteAnyway: this.executeAnyway || undefined,
257+
} as Parameters<typeof this.graphQLService.sdk.asyncSqlExecuteQuery>[0] & { isExecuteAnyway?: boolean });
245258

246259
return taskInfo;
247260
}

0 commit comments

Comments
 (0)