Skip to content

Commit ca43475

Browse files
committed
add quoted variant with OR
1 parent a116f8d commit ca43475

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

Mergin/field_filtering.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,11 @@ def _generate_sql_expression(self) -> None:
181181
self.filter_type in (FieldFilterType.SINGLE_SELECT, FieldFilterType.MULTI_SELECT)
182182
and self.field_has_multi_selection is True
183183
):
184-
expr = f"(',' || TRIM({field}, '{{}}') || ',' ) LIKE '%,' || {SQL_PLACEHOLDER_VALUE} || ',%'"
184+
expr = (
185+
f"((',' || TRIM({field}, '{{}}') || ',' ) LIKE '%,' || {SQL_PLACEHOLDER_VALUE} || ',%')"
186+
"OR"
187+
f"((',' || TRIM({field}, '{{}}') || ',' ) LIKE '%,\"' || {SQL_PLACEHOLDER_VALUE} || '\" ,%')"
188+
)
185189

186190
else:
187191
expr = ""

0 commit comments

Comments
 (0)