Database governance built for humans and agents — controlling changes and access across every major database.
Go cicddata-governancedata-maskingdata-securitydatabase-accessdatabase-governancedevopsdevsecopsflywaygitopsliquibasemongodbmysqloraclepostgresqlschema-migrationssecuritysql-clientsqlservertidb
chore: update check if has schema property (#6452)
boojack5d0490645d6a
diff --git a/frontend/src/components/Issue/form/SelectDatabaseResourceForm/common.ts b/frontend/src/components/Issue/form/SelectDatabaseResourceForm/common.tsindex e461ae95bd..786e2d6e69 100644--- a/frontend/src/components/Issue/form/SelectDatabaseResourceForm/common.ts+++ b/frontend/src/components/Issue/form/SelectDatabaseResourceForm/common.ts@@ -2,7 +2,7 @@ import { flatten } from "lodash-es";import { TransferOption, TreeOption } from "naive-ui";import { useDBSchemaStore } from "@/store";import { ComposedDatabase } from "@/types";-import { Engine } from "@/types/proto/v1/common";+import { hasSchemaProperty } from "@/utils";export interface DatabaseResource {databaseId: string;@@ -33,7 +33,7 @@ export const mapTreeOptions = (label: database.databaseName,};- if (database.instanceEntity.engine === Engine.POSTGRES) {+ if (hasSchemaProperty(database.instanceEntity.engine)) {const schemaNodes = databaseMetadata.schemas.map((schema): DatabaseTreeOption<"schema"> => {const schemaNode: DatabaseTreeOption<"schema"> = {diff --git a/frontend/src/utils/database.ts b/frontend/src/utils/database.tsindex 0f3cb823a3..2bdd6e7f0f 100644--- a/frontend/src/utils/database.ts+++ b/frontend/src/utils/database.ts@@ -4,6 +4,7 @@ import { keyBy } from "lodash-es";import type { Database, DataSourceType, Environment } from "../types";import { hasWorkspacePermissionV1 } from "./role";import { isDev, semverCompare } from "./util";+import { Engine } from "@/types/proto/v1/common";export function allowDatabaseAccess(database: Database,@@ -158,3 +159,13 @@ export function isArchivedDatabase(db: Database): boolean {}return false;}++export const hasSchemaProperty = (databaseEngine: Engine) => {+ return (+ databaseEngine === Engine.POSTGRES ||+ databaseEngine === Engine.SNOWFLAKE ||+ databaseEngine === Engine.ORACLE ||+ databaseEngine === Engine.MSSQL ||+ databaseEngine === Engine.REDSHIFT+ );+};