@@ -13,6 +13,7 @@ import { NzContextMenuService, NzDropdownMenuComponent } from 'ng-zorro-antd/dro
1313import { NzMessageService } from 'ng-zorro-antd/message' ;
1414import { NzFormatEmitEvent } from 'ng-zorro-antd/tree' ;
1515import { DatabaseEnum } from "@renderer/enum/database.enum" ;
16+ import { StringUtils } from "@renderer/utils/string.utils" ;
1617
1718@Component ( {
1819 selector : 'app-management-metadata' ,
@@ -187,9 +188,13 @@ export class MetadataComponent extends BaseComponent implements OnInit {
187188 const dataSource = await this . dataSourceService . getByAliasAsync ( this . rootNode . value ) ;
188189 this . rootNode [ 'sourceType' ] = dataSource . type ;
189190 request . config = dataSource ;
191+
190192 if ( dataSource . type === DatabaseEnum . postgresql ) {
191- request . config . database = this . selectDatabase ;
193+ if ( StringUtils . isNotEmpty ( this . selectDatabase ) ) {
194+ request . config . database = this . selectDatabase ;
195+ }
192196 }
197+
193198 if ( dataSource . type === DatabaseEnum . trino || dataSource . type === DatabaseEnum . presto ) {
194199 this . items = [ ] ;
195200 this . loading . button = false ;
@@ -222,7 +227,9 @@ export class MetadataComponent extends BaseComponent implements OnInit {
222227 request . config = await this . dataSourceService . getByAliasAsync ( this . rootNode . value ) ;
223228
224229 if ( request . config . type === DatabaseEnum . postgresql ) {
225- request . config . database = this . selectDatabase ;
230+ if ( StringUtils . isNotEmpty ( this . selectDatabase ) ) {
231+ request . config . database = this . selectDatabase ;
232+ }
226233 originNode . database = this . selectTable ;
227234 }
228235
0 commit comments