Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions webapp/packages/core-localization/src/locales/en.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ export default [
['ui_processing_cancel', 'Cancel'],
['ui_processing_canceling', 'Cancelling...'],
['ui_create_workflow', 'Create Workflow'],
['ui_still_execute', 'Execute Anyway'],
['ui_workflow_detail', 'Workflow Detail'],
['ui_processing_canceled', 'Canceled'],
['ui_processing_reload', 'Reload'],
Expand Down
1 change: 1 addition & 0 deletions webapp/packages/core-localization/src/locales/zh.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ export default [
['ui_processing_loading', '加载中...'],
['ui_processing_cancel', '取消'],
['ui_create_workflow', '发起变更工单'],
['ui_still_execute', '仍要执行'],
['ui_workflow_detail', '工单详情'],
['ui_processing_canceling', '取消中...'],
['ui_processing_canceled', '已取消'],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import { ConnectionSchemaManagerService } from '@cloudbeaver/plugin-datasource-c
import { NavigationTabsService } from '@cloudbeaver/plugin-navigation-tabs';
import { ConnectionInfoResource, createConnectionParam } from '@cloudbeaver/core-connections';
import { CommonDialogService, DialogueStateResult } from '@cloudbeaver/core-dialogs';
import { LocalStorageSqlDataSource, SqlDataSourceService } from '@cloudbeaver/plugin-sql-editor';
import { LocalStorageSqlDataSource, QueryDataSource, SqlDataSourceService } from '@cloudbeaver/plugin-sql-editor';
import { isSQLEditorTab, SqlEditorNavigatorService } from '@cloudbeaver/plugin-sql-editor-navigation-tab';
import { SqlEditorSessionClosedDialog } from './SqlEditorSessionClosedDialog.js';

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

const onStillExecute = useCallback(async () => {
await (model.source as unknown as QueryDataSource).requestWithExecuteAnyway();
}, [model]);

useEffect(() => {
const SQL_CONTEXT_ERROR_CODE = '508';
if (errorInfo.error !== model.source.error) {
Expand Down Expand Up @@ -209,7 +213,6 @@ export const TableError = observer<Props>(function TableError({ model, loading,
<Button className={s(style, { button: true })} type="button" onClick={onRetry}>
{translate('ui_processing_retry')}
</Button>

{error.workflowId ? (
<Button className={s(style, { button: true })} type="button" onClick={() => onWorkflowDetailNavigate(error.workflowId!)}>
{translate('ui_workflow_detail')}
Expand All @@ -219,6 +222,9 @@ export const TableError = observer<Props>(function TableError({ model, loading,
{translate('ui_create_workflow')}
</Button>
)}
<Button className={s(style, { button: true })} type="button" onClick={onStillExecute}>
{translate('ui_still_execute')}
</Button>
</div>
</div>
);
Expand Down
15 changes: 14 additions & 1 deletion webapp/packages/plugin-sql-editor/src/QueryDataSource.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@ export interface IQueryRequestInfo extends IRequestInfo {
export class QueryDataSource<TOptions extends IDataQueryOptions = IDataQueryOptions> extends ResultSetDataSource<TOptions> {
currentTask: ITask<SqlExecuteInfo> | null;
override requestInfo: IQueryRequestInfo;
/** When true, passes isExecuteAnyway to the API for re-execution despite previous errors */
executeAnyway = false;

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

/** Re-execute SQL with isExecuteAnyway=true, bypassing error state */
async requestWithExecuteAnyway(): Promise<void> {
this.executeAnyway = true;
try {
await this.requestData();
} finally {
this.executeAnyway = false;
}
}

async request(prevResults: IDatabaseResultSet[]): Promise<IDatabaseResultSet[]> {
const options = this.options;
const executionContext = this.executionContext;
Expand Down Expand Up @@ -241,7 +253,8 @@ export class QueryDataSource<TOptions extends IDataQueryOptions = IDataQueryOpti
},
dataFormat: this.dataFormat,
readLogs: options.readLogs,
});
isExecuteAnyway: this.executeAnyway || undefined,
} as Parameters<typeof this.graphQLService.sdk.asyncSqlExecuteQuery>[0] & { isExecuteAnyway?: boolean });

return taskInfo;
}
Expand Down
Loading