diff --git a/dinky-metadata/dinky-metadata-base/src/main/java/org/dinky/metadata/driver/AbstractJdbcDriver.java b/dinky-metadata/dinky-metadata-base/src/main/java/org/dinky/metadata/driver/AbstractJdbcDriver.java index 469b074b75..c8f6e62ca3 100644 --- a/dinky-metadata/dinky-metadata-base/src/main/java/org/dinky/metadata/driver/AbstractJdbcDriver.java +++ b/dinky-metadata/dinky-metadata-base/src/main/java/org/dinky/metadata/driver/AbstractJdbcDriver.java @@ -26,6 +26,7 @@ import org.dinky.assertion.Asserts; import org.dinky.data.constant.CommonConstant; import org.dinky.data.enums.TableType; +import org.dinky.data.exception.BusException; import org.dinky.data.model.Column; import org.dinky.data.model.QueryData; import org.dinky.data.model.Schema; @@ -207,6 +208,7 @@ public List listSchemas() { } } catch (Exception e) { log.error("ListSchemas failed", e); + throw new BusException(e.getMessage()); } finally { close(preparedStatement, results); } @@ -282,7 +284,8 @@ public List listTables(String schemaName) { } } } catch (SQLException e) { - log.error("ListTables Failed", e); + log.error("ListTables error:", e); + throw new BusException(e.getMessage()); } finally { close(preparedStatement, results); } @@ -377,6 +380,7 @@ public List listColumns(String schemaName, String tableName) { } } catch (SQLException e) { log.error("ListColumns error", e); + throw new BusException(e.getMessage()); } finally { close(preparedStatement, results); } @@ -455,6 +459,7 @@ public String getCreateTableSql(Table table) { } } catch (Exception e) { log.error("GetCreateTableSql Failed", e); + throw new BusException(e.getMessage()); } finally { close(preparedStatement, results); } @@ -767,6 +772,7 @@ public List> getSplitSchemaList() { } } catch (SQLException e) { log.error("GetSplitSchemaList failed", e); + throw new BusException(e.getMessage()); } finally { close(preparedStatement, results); } diff --git a/dinky-metadata/dinky-metadata-doris/src/main/java/org/dinky/metadata/constant/DorisConstant.java b/dinky-metadata/dinky-metadata-doris/src/main/java/org/dinky/metadata/constant/DorisConstant.java index 305b79c3d4..983d74daf6 100644 --- a/dinky-metadata/dinky-metadata-doris/src/main/java/org/dinky/metadata/constant/DorisConstant.java +++ b/dinky-metadata/dinky-metadata-doris/src/main/java/org/dinky/metadata/constant/DorisConstant.java @@ -24,11 +24,18 @@ public interface DorisConstant { /** 查询所有database */ String QUERY_ALL_DATABASE = " show databases "; /** 查询所有schema下的所有表 */ - String QUERY_TABLE_BY_SCHEMA = - " select TABLE_NAME AS `NAME`,TABLE_SCHEMA AS `SCHEMA`,TABLE_COMMENT AS COMMENT, '' as" - + " TYPE, '' as CATALOG, '' as ENGINE , '' as OPTIONS , 0 as `ROWS`, null as" - + " CREATE_TIME, null as UPDATE_TIME from information_schema.tables where" - + " TABLE_SCHEMA = '%s' "; + String QUERY_TABLE_BY_SCHEMA = "select TABLE_NAME AS `NAME`,\n" + " TABLE_SCHEMA AS `SCHEMA`,\n" + + " TABLE_COMMENT AS COMMENT,\n" + + " TABLE_TYPE as TYPE,\n" + + " TABLE_CATALOG as CATALOG,\n" + + " ENGINE as ENGINE,\n" + + " CREATE_OPTIONS as OPTIONS,\n" + + " TABLE_ROWS as `ROWS`,\n" + + " CREATE_TIME as CREATE_TIME,\n" + + " UPDATE_TIME as UPDATE_TIME\n" + + "from information_schema.tables" + + " where" + + " TABLE_SCHEMA = '%s' "; /** 查询指定schema.table下的所有列信息 */ String QUERY_COLUMNS_BY_TABLE_AND_SCHEMA = " show full columns from `%s`.`%s` "; } diff --git a/dinky-web/src/pages/DevOps/JobList/index.tsx b/dinky-web/src/pages/DevOps/JobList/index.tsx index f8f907f4a3..ddc2729a07 100644 --- a/dinky-web/src/pages/DevOps/JobList/index.tsx +++ b/dinky-web/src/pages/DevOps/JobList/index.tsx @@ -100,7 +100,7 @@ const JobList = () => { }, []); return ( - + {...PROTABLE_OPTIONS_PUBLIC} search={false} diff --git a/dinky-web/src/pages/RegCenter/DataSource/components/DataSourceDetail/index.tsx b/dinky-web/src/pages/RegCenter/DataSource/components/DataSourceDetail/index.tsx index 0e8065c711..d2c5a8b4ac 100644 --- a/dinky-web/src/pages/RegCenter/DataSource/components/DataSourceDetail/index.tsx +++ b/dinky-web/src/pages/RegCenter/DataSource/components/DataSourceDetail/index.tsx @@ -19,7 +19,10 @@ import { DataSourceDetailBackButton } from '@/components/StyledComponents'; import { Authorized, HasAuthority, useAccess } from '@/hooks/useAccess'; -import { showDataSourceTable } from '@/pages/DataStudio/LeftContainer/DataSource/service'; +import { + clearDataSourceTable, + showDataSourceTable +} from '@/pages/DataStudio/LeftContainer/DataSource/service'; import { StateType, STUDIO_MODEL } from '@/pages/DataStudio/model'; import RightTagsRouter from '@/pages/RegCenter/DataSource/components/DataSourceDetail/RightTagsRouter'; import { QueryParams } from '@/pages/RegCenter/DataSource/components/DataSourceDetail/RightTagsRouter/data'; @@ -148,7 +151,7 @@ const DataSourceDetail = (props: connect) => { icon={} type='primary' hidden={!HasAuthority(PermissionConstants.REGISTRATION_DATA_SOURCE_DETAIL_REFRESH)} - onClick={() => querySchemaTree()} + onClick={() => clearDataSourceTable(selectDatabaseId).then(() => querySchemaTree())} > {l('button.refresh')} diff --git a/dinky-web/src/services/constants.tsx b/dinky-web/src/services/constants.tsx index 43bbe9a839..f7109280da 100644 --- a/dinky-web/src/services/constants.tsx +++ b/dinky-web/src/services/constants.tsx @@ -128,10 +128,10 @@ export const PRO_LIST_CARD_OPTIONS = { */ export const PROTABLE_OPTIONS_PUBLIC: any = { pagination: { - defaultPageSize: 12, + defaultPageSize: 10, hideOnSinglePage: true, showQuickJumper: false, - showSizeChanger: false, + showSizeChanger: true, position: ['bottomCenter'] }, ghost: false,