Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[feature]:(SQLManagement) Support sql analyze #352

Merged
merged 1 commit into from
Dec 22, 2023
Merged
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
12 changes: 11 additions & 1 deletion src/api/SqlManage/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ import {
IGetSqlManageListResp,
IBatchUpdateSqlManageReq,
IBaseRes,
IGetSqlManageRuleTipsResp
IGetSqlManageRuleTipsResp,
IGetSqlManageSqlAnalysisResp
} from '../common.d';

export interface IGetSqlManageListParams {
Expand Down Expand Up @@ -106,6 +107,15 @@ export interface IGetSqlManageRuleTipsParams {
export interface IGetSqlManageRuleTipsReturn
extends IGetSqlManageRuleTipsResp {}

export interface IGetSqlManageSqlAnalysisV1Params {
project_name: string;

sql_manage_id: string;
}

export interface IGetSqlManageSqlAnalysisV1Return
extends IGetSqlManageSqlAnalysisResp {}

export interface IGetSqlManageListV2Params {
project_name: string;

Expand Down
20 changes: 20 additions & 0 deletions src/api/SqlManage/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ import {
IExportSqlManageV1Params,
IGetSqlManageRuleTipsParams,
IGetSqlManageRuleTipsReturn,
IGetSqlManageSqlAnalysisV1Params,
IGetSqlManageSqlAnalysisV1Return,
IGetSqlManageListV2Params,
IGetSqlManageListV2Return
} from './index.d';
Expand Down Expand Up @@ -79,6 +81,24 @@ class SqlManageService extends ServiceBase {
);
}

public GetSqlManageSqlAnalysisV1(
params: IGetSqlManageSqlAnalysisV1Params,
options?: AxiosRequestConfig
) {
const paramsData = this.cloneDeep(params);
const project_name = paramsData.project_name;
delete paramsData.project_name;

const sql_manage_id = paramsData.sql_manage_id;
delete paramsData.sql_manage_id;

return this.get<IGetSqlManageSqlAnalysisV1Return>(
`/v1/projects/${project_name}/sql_manages/${sql_manage_id}/sql_analysis`,
paramsData,
options
);
}

public GetSqlManageListV2(
params: IGetSqlManageListV2Params,
options?: AxiosRequestConfig
Expand Down
48 changes: 32 additions & 16 deletions src/api/common.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,12 @@ export interface IBaseRes {
message?: string;
}

export interface IAffectRows {
count?: number;

err_message?: string;
}

export interface IAuditPlanCount {
audit_plan_count?: number;

Expand Down Expand Up @@ -1385,6 +1391,14 @@ export interface IGetSqlManageRuleTipsResp {
message?: string;
}

export interface IGetSqlManageSqlAnalysisResp {
code?: number;

data?: ISqlAnalysis;

message?: string;
}

export interface IGetSyncInstanceTaskListResV1 {
code?: number;

Expand Down Expand Up @@ -1997,6 +2011,10 @@ export interface IPatchUserGroupReqV1 {
user_name_list?: string[];
}

export interface IPerformanceStatistics {
affect_rows?: IAffectRows;
}

export interface IPersonaliseReqV1 {
title?: string;
}
Expand Down Expand Up @@ -2289,6 +2307,14 @@ export interface ISource {
type?: SourceTypeEnum;
}

export interface ISqlAnalysis {
performance_statistics?: IPerformanceStatistics;

sql_explain?: ISQLExplain;

table_metas?: ITableMetas;
}

export interface ISqlAnalysisResDataV1 {
sql_explain?: ISQLExplain;

Expand Down Expand Up @@ -2427,6 +2453,12 @@ export interface ITableMetaItemHeadResV1 {
field_name?: string;
}

export interface ITableMetas {
err_message?: string;

table_meta_items?: ITableMeta[];
}

export interface ITestAuditPlanNotifyConfigResDataV1 {
is_notify_send_normal?: boolean;

Expand Down Expand Up @@ -3093,12 +3125,6 @@ export interface IWorkflowTemplateDetailResV1 {
workflow_template_name?: string;
}

export interface IAffectRows {
count?: number;

err_message?: string;
}

export interface IAuditPlanReportSQLResV2 {
audit_plan_report_sql?: string;

Expand Down Expand Up @@ -3421,10 +3447,6 @@ export interface IPartialSyncAuditPlanSQLsReqV2 {
audit_plan_sql_list?: IAuditPlanSQLReqV2[];
}

export interface IPerformanceStatistics {
affect_rows?: IAffectRows;
}

export interface IRejectWorkflowReqV2 {
reason?: string;
}
Expand All @@ -3435,12 +3457,6 @@ export interface IRuleTemplateV2 {
name?: string;
}

export interface ITableMetas {
err_message?: string;

table_meta_items?: ITableMeta[];
}

export interface ITaskAnalysisDataV2 {
performance_statistics?: IPerformanceStatistics;

Expand Down
1 change: 1 addition & 0 deletions src/locale/zh-CN/sqlManagement.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ export default {
status: '状态',
comment: '备注',
endpoint: '端点信息',
analyze: '分析',

actions: {
batchAssignment: '批量指派',
Expand Down
58 changes: 36 additions & 22 deletions src/page/SQLManagement/SQLPanel/column.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -49,242 +49,256 @@
id: number,
status: BatchUpdateSqlManageReqStatusEnum
) => Promise<void> | undefined;
handleClickAnalyze: (sqlManageId: string) => void;
}) => Array<
| (ColumnGroupType<ISqlManage> | ColumnType<ISqlManage>) & {
dataIndex?: keyof ISqlManage | 'operator';
}
> = ({
projectName,
updateRemark,
signalActionsLoading,
signalAssignment,
actionPermission,
username,
updateSQLStatus,
handleClickAnalyze,
}) => {
const columns: Array<
| (ColumnGroupType<ISqlManage> | ColumnType<ISqlManage>) & {
dataIndex?: keyof ISqlManage | 'operator';
}
> = [
{
dataIndex: 'sql_fingerprint',
title: () => t('sqlManagement.table.SQLFingerprint'),
className: 'table-column-sql-fingerprint',
render: (sql: string) => <RenderExecuteSql sql={sql} rows={2} />,
},
{
dataIndex: 'sql',
title: () => 'SQL',
className: 'table-column-sql',
render: (sql: string) => <RenderExecuteSql sql={sql} rows={2} />,
},
{
dataIndex: 'source',
title: () => t('sqlManagement.table.source'),
render: (source: ISource) => {
if (source.type && source.type === SourceTypeEnum.audit_plan) {
return (
<Link
to={`project/${projectName}/auditPlan/detail/${source.audit_plan_name}`}
>
{t(sourceDictionary[source.type])}
</Link>
);
} else if (
source.type &&
source.type === SourceTypeEnum.sql_audit_record
) {
return (
<Link
to={`project/${projectName}/sqlAudit?${
SQLAuditRecordListUrlParamsKey.SQLAuditRecordID
}=${
source.sql_audit_record_ids?.join(
SQLAuditRecordIDValuesSplit
) ?? ''
}`}
>
{t(sourceDictionary[source.type])}
</Link>
);
}
return '--';
},
},
{
dataIndex: 'instance_name',
title: () => t('sqlManagement.table.instanceName'),
render: (name) => {
if (!name) {
return '--';
}
return name;
},
},
{
dataIndex: 'schema_name',
title: () => 'Schema',
render: (schema) => {
if (!schema) {
return '--';
}
return schema;
},
},
{
dataIndex: 'audit_result',
title: () => t('sqlManagement.table.auditResult'),
render: (auditResult: IAuditResult[]) => {
return <AuditResultInfo auditResult={auditResult} />;
},
},
Table.EXPAND_COLUMN,
{
dataIndex: 'first_appear_timestamp',
title: () => t('sqlManagement.table.firstOccurrence'),
render: (time: string) => {
return formatTime(time, '--');
},
sorter: true,
sortDirections: ['descend', 'ascend'],
},
{
dataIndex: 'last_receive_timestamp',
title: () => t('sqlManagement.table.lastOccurrence'),
render: (time: string) => {
return formatTime(time, '--');
},
sorter: true,
sortDirections: ['descend', 'ascend'],
},
{
dataIndex: 'fp_count',
title: () => t('sqlManagement.table.occurrenceCount'),
sorter: true,
sortDirections: ['descend', 'ascend'],
},

{
dataIndex: 'assignees',
title: () => t('sqlManagement.table.personInCharge'),
render: (assignees: string[]) => {
if (!Array.isArray(assignees)) {
return '--';
}
return assignees.map((v) => <Tag key={v}>{v}</Tag>);
},
},
{
dataIndex: 'endpoints',
title: () => t('sqlManagement.table.endpoint'),
render: (endpoints: string[]) => {
if (!Array.isArray(endpoints) || endpoints.length === 0) {
return '--';
}
if (endpoints.length === 1) {
return <Tag>{endpoints[0]}</Tag>;
}
return (
<Popover
content={
<div style={{ maxWidth: '600px' }}>
<Space wrap>
{endpoints.map((v) => (
<Tag key={v}>{v}</Tag>
))}
</Space>
</div>
}
>
<Tag>{endpoints[0]}</Tag>
{endpoints.length > 1 ? '...' : null}
</Popover>
);
},
},
{
dataIndex: 'status',
title: () => t('sqlManagement.table.status'),
render: (status: SqlManageStatusEnum) => {
if (!status) {
return '--';
}
const colorDictionary: Record<
GetSqlManageListFilterStatusEnum,
TagProps['color']
> = {
[GetSqlManageListFilterStatusEnum.ignored]: 'gray',
[GetSqlManageListFilterStatusEnum.solved]: 'green',
[GetSqlManageListFilterStatusEnum.unhandled]: 'red',
[GetSqlManageListFilterStatusEnum.manual_audited]: 'blue',
};
return (
<Tag color={colorDictionary[status]}>
{t(statusDictionary[status])}
</Tag>
);
},
},
{
dataIndex: 'remark',
title: () => t('sqlManagement.table.comment'),
width: 200,
render: (remark: string, record) => {
return (
<EmptyBox
if={actionPermission}
defaultNode={<>{renderRemark(remark) ?? '--'}</>}
>
<EditText
editable={{
autoSize: true,
onEnd: (val) => {
updateRemark(record.id ?? 0, val);
},
}}
>
{remark}
</EditText>
</EmptyBox>
);
},
},

{
dataIndex: 'operator',
title: () => t('common.operate'),
fixed: 'right',
render: (_, record) => {
return (
<Space>
<AssignMember
projectName={projectName}
disabled={signalActionsLoading}
onConfirm={(members: string[]) =>
signalAssignment(record.id ?? 0, members)
}
>
<Typography.Link>
{t('sqlManagement.table.assignMember.label')}
</Typography.Link>
</AssignMember>
<EmptyBox if={actionPermission}>
<AssignMember
projectName={projectName}
disabled={signalActionsLoading}
onConfirm={(members: string[]) =>
signalAssignment(record.id ?? 0, members)

Check warning on line 267 in src/page/SQLManagement/SQLPanel/column.tsx

View workflow job for this annotation

GitHub Actions / Coverage annotations (🧪 jest-coverage-report-action)

🧾 Statement is not covered

Warning! Not covered statement

Check warning on line 267 in src/page/SQLManagement/SQLPanel/column.tsx

View workflow job for this annotation

GitHub Actions / Coverage annotations (🧪 jest-coverage-report-action)

🌿 Branch is not covered

Warning! Not covered branch

Check warning on line 267 in src/page/SQLManagement/SQLPanel/column.tsx

View workflow job for this annotation

GitHub Actions / Coverage annotations (🧪 jest-coverage-report-action)

🌿 Branch is not covered

Warning! Not covered branch
}
>
<Typography.Link>
{t('sqlManagement.table.assignMember.label')}
</Typography.Link>
</AssignMember>
</EmptyBox>

<EmptyBox if={actionPermission}>
<UpdateSQLStatus
disabled={signalActionsLoading}
onConfirm={(status) => updateSQLStatus(record.id ?? 0, status)}

Check warning on line 279 in src/page/SQLManagement/SQLPanel/column.tsx

View workflow job for this annotation

GitHub Actions / Coverage annotations (🧪 jest-coverage-report-action)

🧾 Statement is not covered

Warning! Not covered statement

Check warning on line 279 in src/page/SQLManagement/SQLPanel/column.tsx

View workflow job for this annotation

GitHub Actions / Coverage annotations (🧪 jest-coverage-report-action)

🌿 Branch is not covered

Warning! Not covered branch

Check warning on line 279 in src/page/SQLManagement/SQLPanel/column.tsx

View workflow job for this annotation

GitHub Actions / Coverage annotations (🧪 jest-coverage-report-action)

🌿 Branch is not covered

Warning! Not covered branch
>
<Typography.Link>
{t('sqlManagement.table.updateStatus.triggerText')}
</Typography.Link>
</UpdateSQLStatus>
</EmptyBox>

<UpdateSQLStatus
disabled={signalActionsLoading}
onConfirm={(status) => updateSQLStatus(record.id ?? 0, status)}
<Typography.Link
disabled={
!record.sql || !record.schema_name || !record.instance_name

Check warning on line 289 in src/page/SQLManagement/SQLPanel/column.tsx

View workflow job for this annotation

GitHub Actions / Coverage annotations (🧪 jest-coverage-report-action)

🌿 Branch is not covered

Warning! Not covered branch

Check warning on line 289 in src/page/SQLManagement/SQLPanel/column.tsx

View workflow job for this annotation

GitHub Actions / Coverage annotations (🧪 jest-coverage-report-action)

🌿 Branch is not covered

Warning! Not covered branch
}
onClick={() => {
handleClickAnalyze(record.id?.toString() ?? '');

Check warning on line 292 in src/page/SQLManagement/SQLPanel/column.tsx

View workflow job for this annotation

GitHub Actions / Coverage annotations (🧪 jest-coverage-report-action)

🧾 Statement is not covered

Warning! Not covered statement
}}
>
<Typography.Link>
{t('sqlManagement.table.updateStatus.triggerText')}
</Typography.Link>
</UpdateSQLStatus>
{t('sqlManagement.table.analyze')}
</Typography.Link>
</Space>
);

Check warning on line 298 in src/page/SQLManagement/SQLPanel/column.tsx

View workflow job for this annotation

GitHub Actions / Coverage annotations (🧪 jest-coverage-report-action)

🧾 Statement is not covered

Warning! Not covered statement
},
},
];

Check warning on line 301 in src/page/SQLManagement/SQLPanel/column.tsx

View workflow job for this annotation

GitHub Actions / Coverage annotations (🧪 jest-coverage-report-action)

🧾 Statement is not covered

Warning! Not covered statement
if (!actionPermission) {
return columns.filter((v) => v.dataIndex !== 'operator');
}

return columns;
};

Check warning on line 304 in src/page/SQLManagement/SQLPanel/column.tsx

View workflow job for this annotation

GitHub Actions / Coverage annotations (🧪 jest-coverage-report-action)

🧾 Statement is not covered

Warning! Not covered statement
5 changes: 5 additions & 0 deletions src/page/SQLManagement/SQLPanel/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -306,6 +306,10 @@ const SQLPanel: React.FC = () => {
]
);

const handleClickAnalyze = (sqlManageId: string) => {
window.open(`/project/${projectName}/sqlManagement/${sqlManageId}/analyze`);
};

const [
exportButtonDisabled,
{ setFalse: finishExport, setTrue: startExport },
Expand Down Expand Up @@ -454,6 +458,7 @@ const SQLPanel: React.FC = () => {
actionPermission,
username,
updateSQLStatus,
handleClickAnalyze,
})}
pagination={{
showSizeChanger: true,
Expand Down
77 changes: 77 additions & 0 deletions src/page/SqlAnalyze/SqlManage/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
import { useBoolean } from 'ahooks';
import { ResultStatusType } from 'antd/lib/result';
import { useCallback, useEffect, useState } from 'react';
import { useParams } from 'react-router-dom';
import {
IPerformanceStatistics,
ISQLExplain,
ITableMetas,
} from '../../../api/common';
import { ResponseCode } from '../../../data/common';
import SqlAnalyze from '../SqlAnalyze';
import { SQLManageAnalyzeUrlParams } from './index.type';
import SqlManage from '../../../api/SqlManage';
import { useCurrentProjectName } from '../../ProjectManage/ProjectDetail';

const SQLManageAnalyze = () => {

Check warning on line 16 in src/page/SqlAnalyze/SqlManage/index.tsx

View workflow job for this annotation

GitHub Actions / Coverage annotations (🧪 jest-coverage-report-action)

🕹️ Function is not covered

Warning! Not covered function
const urlParams = useParams<SQLManageAnalyzeUrlParams>();

Check warning on line 17 in src/page/SqlAnalyze/SqlManage/index.tsx

View workflow job for this annotation

GitHub Actions / Coverage annotations (🧪 jest-coverage-report-action)

🧾 Statement is not covered

Warning! Not covered statement
const { projectName } = useCurrentProjectName();

Check warning on line 18 in src/page/SqlAnalyze/SqlManage/index.tsx

View workflow job for this annotation

GitHub Actions / Coverage annotations (🧪 jest-coverage-report-action)

🧾 Statement is not covered

Warning! Not covered statement
const [errorMessage, setErrorMessage] = useState<string>('');

Check warning on line 19 in src/page/SqlAnalyze/SqlManage/index.tsx

View workflow job for this annotation

GitHub Actions / Coverage annotations (🧪 jest-coverage-report-action)

🧾 Statement is not covered

Warning! Not covered statement

const [sqlExplain, setSqlExplain] = useState<ISQLExplain>();

Check warning on line 21 in src/page/SqlAnalyze/SqlManage/index.tsx

View workflow job for this annotation

GitHub Actions / Coverage annotations (🧪 jest-coverage-report-action)

🧾 Statement is not covered

Warning! Not covered statement
const [tableMetas, setTableMetas] = useState<ITableMetas>();

Check warning on line 22 in src/page/SqlAnalyze/SqlManage/index.tsx

View workflow job for this annotation

GitHub Actions / Coverage annotations (🧪 jest-coverage-report-action)

🧾 Statement is not covered

Warning! Not covered statement
const [performanceStatistics, setPerformancesStatistics] =
useState<IPerformanceStatistics>();

Check warning on line 24 in src/page/SqlAnalyze/SqlManage/index.tsx

View workflow job for this annotation

GitHub Actions / Coverage annotations (🧪 jest-coverage-report-action)

🧾 Statement is not covered

Warning! Not covered statement
const [
loading,
{ setTrue: startGetSqlAnalyze, setFalse: getSqlAnalyzeFinish },
] = useBoolean();

Check warning on line 28 in src/page/SqlAnalyze/SqlManage/index.tsx

View workflow job for this annotation

GitHub Actions / Coverage annotations (🧪 jest-coverage-report-action)

🧾 Statement is not covered

Warning! Not covered statement
const [errorType, setErrorType] = useState<ResultStatusType>('error');

Check warning on line 29 in src/page/SqlAnalyze/SqlManage/index.tsx

View workflow job for this annotation

GitHub Actions / Coverage annotations (🧪 jest-coverage-report-action)

🧾 Statement is not covered

Warning! Not covered statement

const getSqlAnalyze = useCallback(async () => {

Check warning on line 31 in src/page/SqlAnalyze/SqlManage/index.tsx

View workflow job for this annotation

GitHub Actions / Coverage annotations (🧪 jest-coverage-report-action)

🕹️ Function is not covered

Warning! Not covered function
startGetSqlAnalyze();

Check warning on line 32 in src/page/SqlAnalyze/SqlManage/index.tsx

View workflow job for this annotation

GitHub Actions / Coverage annotations (🧪 jest-coverage-report-action)

🧾 Statement is not covered

Warning! Not covered statement
try {
const res = await SqlManage.GetSqlManageSqlAnalysisV1({
sql_manage_id: urlParams.sqlManageId ?? '',

Check warning on line 35 in src/page/SqlAnalyze/SqlManage/index.tsx

View workflow job for this annotation

GitHub Actions / Coverage annotations (🧪 jest-coverage-report-action)

🌿 Branch is not covered

Warning! Not covered branch

Check warning on line 35 in src/page/SqlAnalyze/SqlManage/index.tsx

View workflow job for this annotation

GitHub Actions / Coverage annotations (🧪 jest-coverage-report-action)

🌿 Branch is not covered

Warning! Not covered branch
project_name: projectName,
});

Check warning on line 37 in src/page/SqlAnalyze/SqlManage/index.tsx

View workflow job for this annotation

GitHub Actions / Coverage annotations (🧪 jest-coverage-report-action)

🧾 Statement is not covered

Warning! Not covered statement
if (res.data.code === ResponseCode.SUCCESS) {
setErrorMessage('');

Check warning on line 39 in src/page/SqlAnalyze/SqlManage/index.tsx

View workflow job for this annotation

GitHub Actions / Coverage annotations (🧪 jest-coverage-report-action)

🧾 Statement is not covered

Warning! Not covered statement
setSqlExplain(res.data.data?.sql_explain);

Check warning on line 40 in src/page/SqlAnalyze/SqlManage/index.tsx

View workflow job for this annotation

GitHub Actions / Coverage annotations (🧪 jest-coverage-report-action)

🧾 Statement is not covered

Warning! Not covered statement
setTableMetas(res.data.data?.table_metas);

Check warning on line 41 in src/page/SqlAnalyze/SqlManage/index.tsx

View workflow job for this annotation

GitHub Actions / Coverage annotations (🧪 jest-coverage-report-action)

🧾 Statement is not covered

Warning! Not covered statement
setPerformancesStatistics(res.data.data?.performance_statistics);

Check warning on line 42 in src/page/SqlAnalyze/SqlManage/index.tsx

View workflow job for this annotation

GitHub Actions / Coverage annotations (🧪 jest-coverage-report-action)

🧾 Statement is not covered

Warning! Not covered statement
} else {
if (res.data.code === ResponseCode.NotSupportDML) {
setErrorType('info');

Check warning on line 45 in src/page/SqlAnalyze/SqlManage/index.tsx

View workflow job for this annotation

GitHub Actions / Coverage annotations (🧪 jest-coverage-report-action)

🧾 Statement is not covered

Warning! Not covered statement
} else {
setErrorType('error');

Check warning on line 47 in src/page/SqlAnalyze/SqlManage/index.tsx

View workflow job for this annotation

GitHub Actions / Coverage annotations (🧪 jest-coverage-report-action)

🧾 Statement is not covered

Warning! Not covered statement
}

Check warning on line 48 in src/page/SqlAnalyze/SqlManage/index.tsx

View workflow job for this annotation

GitHub Actions / Coverage annotations (🧪 jest-coverage-report-action)

🧾 Statement is not covered

Warning! Not covered statement

Check warning on line 48 in src/page/SqlAnalyze/SqlManage/index.tsx

View workflow job for this annotation

GitHub Actions / Coverage annotations (🧪 jest-coverage-report-action)

🌿 Branch is not covered

Warning! Not covered branch

Check warning on line 48 in src/page/SqlAnalyze/SqlManage/index.tsx

View workflow job for this annotation

GitHub Actions / Coverage annotations (🧪 jest-coverage-report-action)

🌿 Branch is not covered

Warning! Not covered branch
setErrorMessage(res.data.message ?? '');

Check warning on line 49 in src/page/SqlAnalyze/SqlManage/index.tsx

View workflow job for this annotation

GitHub Actions / Coverage annotations (🧪 jest-coverage-report-action)

🧾 Statement is not covered

Warning! Not covered statement

Check warning on line 49 in src/page/SqlAnalyze/SqlManage/index.tsx

View workflow job for this annotation

GitHub Actions / Coverage annotations (🧪 jest-coverage-report-action)

🌿 Branch is not covered

Warning! Not covered branch

Check warning on line 49 in src/page/SqlAnalyze/SqlManage/index.tsx

View workflow job for this annotation

GitHub Actions / Coverage annotations (🧪 jest-coverage-report-action)

🌿 Branch is not covered

Warning! Not covered branch
}

Check warning on line 50 in src/page/SqlAnalyze/SqlManage/index.tsx

View workflow job for this annotation

GitHub Actions / Coverage annotations (🧪 jest-coverage-report-action)

🧾 Statement is not covered

Warning! Not covered statement

Check warning on line 50 in src/page/SqlAnalyze/SqlManage/index.tsx

View workflow job for this annotation

GitHub Actions / Coverage annotations (🧪 jest-coverage-report-action)

🌿 Branch is not covered

Warning! Not covered branch

Check warning on line 50 in src/page/SqlAnalyze/SqlManage/index.tsx

View workflow job for this annotation

GitHub Actions / Coverage annotations (🧪 jest-coverage-report-action)

🌿 Branch is not covered

Warning! Not covered branch
} finally {
getSqlAnalyzeFinish();

Check warning on line 52 in src/page/SqlAnalyze/SqlManage/index.tsx

View workflow job for this annotation

GitHub Actions / Coverage annotations (🧪 jest-coverage-report-action)

🧾 Statement is not covered

Warning! Not covered statement
}

Check warning on line 53 in src/page/SqlAnalyze/SqlManage/index.tsx

View workflow job for this annotation

GitHub Actions / Coverage annotations (🧪 jest-coverage-report-action)

🧾 Statement is not covered

Warning! Not covered statement
}, [
getSqlAnalyzeFinish,
projectName,
startGetSqlAnalyze,
urlParams.sqlManageId,
]);

Check warning on line 59 in src/page/SqlAnalyze/SqlManage/index.tsx

View workflow job for this annotation

GitHub Actions / Coverage annotations (🧪 jest-coverage-report-action)

🧾 Statement is not covered

Warning! Not covered statement

useEffect(() => {

Check warning on line 61 in src/page/SqlAnalyze/SqlManage/index.tsx

View workflow job for this annotation

GitHub Actions / Coverage annotations (🧪 jest-coverage-report-action)

🕹️ Function is not covered

Warning! Not covered function
getSqlAnalyze();

Check warning on line 62 in src/page/SqlAnalyze/SqlManage/index.tsx

View workflow job for this annotation

GitHub Actions / Coverage annotations (🧪 jest-coverage-report-action)

🧾 Statement is not covered

Warning! Not covered statement
}, [getSqlAnalyze]);

Check warning on line 63 in src/page/SqlAnalyze/SqlManage/index.tsx

View workflow job for this annotation

GitHub Actions / Coverage annotations (🧪 jest-coverage-report-action)

🧾 Statement is not covered

Warning! Not covered statement

return (
<SqlAnalyze
errorType={errorType}
tableMetas={tableMetas}
sqlExplain={sqlExplain}
errorMessage={errorMessage}
performanceStatistics={performanceStatistics}
loading={loading}
/>
);

Check warning on line 74 in src/page/SqlAnalyze/SqlManage/index.tsx

View workflow job for this annotation

GitHub Actions / Coverage annotations (🧪 jest-coverage-report-action)

🧾 Statement is not covered

Warning! Not covered statement
};

Check warning on line 75 in src/page/SqlAnalyze/SqlManage/index.tsx

View workflow job for this annotation

GitHub Actions / Coverage annotations (🧪 jest-coverage-report-action)

🧾 Statement is not covered

Warning! Not covered statement

export default SQLManageAnalyze;
3 changes: 3 additions & 0 deletions src/page/SqlAnalyze/SqlManage/index.type.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export type SQLManageAnalyzeUrlParams = {
sqlManageId: string;
};
Loading