Skip to content

Database governance built for humans and agents — controlling changes and access across every major database.

fix: update schema cache (#10203)

ecmadao7ab0cc485ba9
diff --git a/frontend/src/components/SensitiveData/SensitiveColumnDrawer.vue b/frontend/src/components/SensitiveData/SensitiveColumnDrawer.vue
index a7f53d906e..8135b0d7e5 100644
--- a/frontend/src/components/SensitiveData/SensitiveColumnDrawer.vue
+++ b/frontend/src/components/SensitiveData/SensitiveColumnDrawer.vue
@@ -437,9 +437,13 @@ const onAccessControlUpdate = async (
const onMaskingLevelUpdate = async (level: MaskingLevel) => {
state.maskingLevel = level;
await onColumnMaskingUpdate();
- await dbSchemaStore.getOrFetchDatabaseMetadata({
+
+ dbSchemaStore.getOrFetchTableMetadata({
database: props.column.database.name,
+ schema: props.column.maskData.schema,
+ table: props.column.maskData.table,
skipCache: true,
+ silent: false,
});
};
diff --git a/frontend/src/store/modules/v1/dbSchema.ts b/frontend/src/store/modules/v1/dbSchema.ts
index 6d74626748..1e68dc8138 100644
--- a/frontend/src/store/modules/v1/dbSchema.ts
+++ b/frontend/src/store/modules/v1/dbSchema.ts
@@ -32,9 +32,9 @@ export const useDBSchemaV1Store = defineStore("dbSchema_v1", {
this._databaseMetadataByName.set(metadata.name, metadata);
return metadata;
},
- mergeToCache(metadata: DatabaseMetadata) {
+ mergeToCache(metadata: DatabaseMetadata, override: boolean) {
const existed = this._databaseMetadataByName.get(metadata.name);
- if (!existed) {
+ if (!existed || override) {
return this.setCache(metadata);
}
@@ -91,8 +91,11 @@ export const useDBSchemaV1Store = defineStore("dbSchema_v1", {
databaseMetadata: metadata,
updateMask: ["schema_configs"],
});
- this.mergeToCache(metadata);
- return metadata;
+ const existed = this._databaseMetadataByName.get(metadata.name);
+ if (existed) {
+ existed.schemaConfigs = metadata.schemaConfigs;
+ this.setCache(metadata);
+ }
},
async getOrFetchDatabaseMetadata({
database,
@@ -147,7 +150,10 @@ export const useDBSchemaV1Store = defineStore("dbSchema_v1", {
}
)
.then((res) => {
- this.mergeToCache(res);
+ this.mergeToCache(
+ res,
+ view === DatabaseMetadataView.DATABASE_METADATA_VIEW_FULL
+ );
return res;
});
this.requestCache.set(metadataName, promise);
@@ -241,7 +247,7 @@ export const useDBSchemaV1Store = defineStore("dbSchema_v1", {
}
}
}
- this.mergeToCache(res);
+ this.mergeToCache(res, false);
return tableMetadata;
});
},
diff --git a/frontend/src/views/ProfileDashboard.vue b/frontend/src/views/ProfileDashboard.vue
index 74317cc24e..3eb9ba818f 100644
--- a/frontend/src/views/ProfileDashboard.vue
+++ b/frontend/src/views/ProfileDashboard.vue
@@ -12,7 +12,7 @@
<div
class="mt-6 sm:flex-1 sm:min-w-0 sm:flex sm:items-center sm:justify-end sm:space-x-6 sm:pb-1"
>
- <div class="mt-6 flex flex-row justify-stretch space-x-4">
+ <div class="mt-6 flex flex-row justify-stretch space-x-2">
<template v-if="allowEdit">
<template v-if="state.editing">
<NButton @click.prevent="cancelEdit">