mirror of
https://github.com/windmill-labs/windmill.git
synced 2026-10-30 08:16:49 +00:00
Merge commit from fork
Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5
parent
8af484292f
commit
812ff6ea5e
@@ -439,9 +439,10 @@ async fn list_resources(
|
||||
|
||||
if let Some(broad_filter) = &lq.broad_filter {
|
||||
let pat = format!("%{}%", escape_ilike_pattern(broad_filter));
|
||||
// `binds` fills every `?` in one pass; chained `bind`s would re-scan a `?` in the bound value
|
||||
sqlb.and_where(
|
||||
"(resource.path ILIKE ? OR resource.description ILIKE ? OR resource_type ILIKE ? OR resource.value::text ILIKE ?)"
|
||||
.bind(&pat).bind(&pat).bind(&pat).bind(&pat)
|
||||
.binds(&[&pat]),
|
||||
);
|
||||
}
|
||||
|
||||
@@ -455,10 +456,10 @@ async fn list_resources(
|
||||
|
||||
if let Some(label) = &lq.label {
|
||||
for l in label.split(',') {
|
||||
// `binds` fills every `?` in one pass; chained `bind`s would re-scan a `?` in the bound value
|
||||
sqlb.and_where(
|
||||
"(resource.labels @> ARRAY[?] OR folder_labels(resource.workspace_id, resource.path) @> ARRAY[?])"
|
||||
.bind(&l.trim())
|
||||
.bind(&l.trim()),
|
||||
.binds(&[&l.trim()]),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -200,18 +200,19 @@ async fn list_variables(
|
||||
|
||||
if let Some(broad_filter) = &lq.broad_filter {
|
||||
let pat = format!("%{}%", escape_ilike_pattern(broad_filter));
|
||||
// `binds` fills every `?` in one pass; chained `bind`s would re-scan a `?` in the bound value
|
||||
sqlb.and_where(
|
||||
"(variable.path ILIKE ? OR variable.description ILIKE ? OR (is_secret = FALSE AND variable.value ILIKE ?))"
|
||||
.bind(&pat).bind(&pat).bind(&pat)
|
||||
.binds(&[&pat]),
|
||||
);
|
||||
}
|
||||
|
||||
if let Some(label) = &lq.label {
|
||||
for l in label.split(',') {
|
||||
// `binds` fills every `?` in one pass; chained `bind`s would re-scan a `?` in the bound value
|
||||
sqlb.and_where(
|
||||
"(variable.labels @> ARRAY[?] OR folder_labels(variable.workspace_id, variable.path) @> ARRAY[?])"
|
||||
.bind(&l.trim())
|
||||
.bind(&l.trim()),
|
||||
.binds(&[&l.trim()]),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user