Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 8 additions & 6 deletions store/postgres/src/relational_queries.rs
Original file line number Diff line number Diff line change
Expand Up @@ -873,9 +873,9 @@ impl<'a> QueryFilter<'a> {
Value::String(s) => {
out.push_identifier(column.name.as_str())?;
if negated {
out.push_sql(" not like ");
out.push_sql(" not ilike ");
} else {
out.push_sql(" like ")
out.push_sql(" ilike ")
};
if s.starts_with('%') || s.ends_with('%') {
out.push_bind_param::<Text, _>(s)?;
Expand Down Expand Up @@ -1149,14 +1149,16 @@ impl<'a> QueryFragment<Pg> for QueryFilter<'a> {
NotIn(attr, values) => self.in_array(attr, values, true, out)?,

StartsWith(attr, value) => {
self.starts_or_ends_with(attr, value, " like ", true, out)?
self.starts_or_ends_with(attr, value, " ilike ", true, out)?
}
NotStartsWith(attr, value) => {
self.starts_or_ends_with(attr, value, " not like ", true, out)?
self.starts_or_ends_with(attr, value, " not ilike ", true, out)?
}
EndsWith(attr, value) => {
self.starts_or_ends_with(attr, value, " ilike ", false, out)?
}
EndsWith(attr, value) => self.starts_or_ends_with(attr, value, " like ", false, out)?,
NotEndsWith(attr, value) => {
self.starts_or_ends_with(attr, value, " not like ", false, out)?
self.starts_or_ends_with(attr, value, " not ilike ", false, out)?
}
}
Ok(())
Expand Down