@@ -7,6 +7,7 @@ import { v4 as uuid } from 'uuid';
77import sqlService from '@/service/sql' ;
88import i18n from '@/i18n' ;
99import { debounce } from 'lodash' ;
10+ import { DatabaseTypeCode } from '@/constants' ;
1011
1112interface IProps {
1213 className ?: string ;
@@ -26,6 +27,9 @@ export interface ICreateDatabase {
2627 comment ?: string ;
2728}
2829
30+ // 创建database不支持注释的数据库
31+ const noCommentDatabase = [ DatabaseTypeCode . MYSQL ] ;
32+
2933export default forwardRef ( ( props : IProps , ref : ForwardedRef < ICreateDatabaseRef > ) => {
3034 const { className, curWorkspaceParams, executedCallback } = props ;
3135 const [ form ] = Form . useForm < ICreateDatabase > ( ) ;
@@ -91,7 +95,7 @@ export default forwardRef((props: IProps, ref: ForwardedRef<ICreateDatabaseRef>)
9195 monacoEditorRef . current ?. setValue ( sql , 'cover' ) ;
9296 } ) ;
9397 } , 500 ) ,
94- [ ] ,
98+ [ curWorkspaceParams , createType , monacoEditorRef , config ] ,
9599 ) ;
96100
97101 const executeUpdateDataSql = ( sql : string ) => {
@@ -139,9 +143,11 @@ export default forwardRef((props: IProps, ref: ForwardedRef<ICreateDatabaseRef>)
139143 < Form . Item label = { i18n ( 'common.label.name' ) } name = { config . formName } >
140144 < Input autoComplete = "off" />
141145 </ Form . Item >
142- < Form . Item label = { i18n ( 'common.label.comment' ) } name = "comment" >
143- < Input autoComplete = "off" />
144- </ Form . Item >
146+ { noCommentDatabase . includes ( curWorkspaceParams . databaseType ) ? null : (
147+ < Form . Item label = { i18n ( 'common.label.comment' ) } name = "comment" >
148+ < Input autoComplete = "off" />
149+ </ Form . Item >
150+ ) }
145151 </ Form >
146152 < div className = { styles . previewBox } >
147153 < div className = { styles . previewText } > { i18n ( 'common.title.preview' ) } </ div >
0 commit comments