Skip to content

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

fix: filter databases by table (#19135)

ecmadaofbd63d6f0948
diff --git a/backend/store/database.go b/backend/store/database.go
index 86bf4c99c4..95aea92973 100644
--- a/backend/store/database.go
+++ b/backend/store/database.go
@@ -599,7 +599,7 @@ func GetListDatabaseFilter(filter string) (*qb.Query, error) {
SELECT 1
FROM json_array_elements(ds.metadata->'schemas') AS s,
json_array_elements(s->'tables') AS t
- WHERE t->>'name' LIKE ?`, "%"+strValue+"%"), nil
+ WHERE t->>'name' LIKE ?)`, "%"+strValue+"%"), nil
default:
return nil, errors.Errorf(`only "name" or "table" support %q operator, but found %q`, celoverloads.Matches, variable)
}
diff --git a/frontend/src/components/AdvancedSearch/AdvancedSearch.vue b/frontend/src/components/AdvancedSearch/AdvancedSearch.vue
index b57798057c..206f0093eb 100644
--- a/frontend/src/components/AdvancedSearch/AdvancedSearch.vue
+++ b/frontend/src/components/AdvancedSearch/AdvancedSearch.vue
@@ -81,7 +81,7 @@
<script lang="ts" setup>
import { onClickOutside, useDebounceFn } from "@vueuse/core";
-import { cloneDeep, last } from "lodash-es";
+import { cloneDeep, isEqual, last } from "lodash-es";
import { FilterIcon, XIcon } from "lucide-vue-next";
import { type InputInst, NButton, NInput } from "naive-ui";
import scrollIntoView from "scroll-into-view-if-needed";
@@ -471,7 +471,10 @@ const maybeDeselectMismatchedScope = () => {
};
const maybeEmitIncompleteValue = () => {
- if (!inputText.value.startsWith(`${state.currentScope}:`)) {
+ if (
+ !inputText.value.startsWith(`${state.currentScope}:`) &&
+ props.params.query !== inputText.value
+ ) {
const updated = cloneDeep(props.params);
updated.query = inputText.value;
updateParams(updated);
@@ -694,10 +697,13 @@ watch(visibleValueOptions, (newOptions, oldOptions) => {
watch(
() => props.params,
- (params) => {
- inputText.value = params.query;
+ (newParams, oldParams) => {
+ if (isEqual(newParams, oldParams)) {
+ return;
+ }
+ inputText.value = newParams.query;
if (props.cacheQuery) {
- cachedQuery.value = buildSearchTextBySearchParams(params);
+ cachedQuery.value = buildSearchTextBySearchParams(newParams);
}
},
{ deep: true }