use literal substrings in SQL LIKE queries - #156
Conversation
Treat user-provided URI, title, and search values as literal substrings in SQL LIKE queries. Escape LIKE metacharacters while retaining the surrounding substring wildcards, preserving ordinary matching and bound parameters while preventing unintended matches during pattern deletion. Implements #155.
dstlled-diffexpanddiff --git a/71f75b64/src/persistence/get.rs b/55e35dba/src/persistence/get.rs
index 6ef22e1..ab26f3a 100644
--- a/71f75b64/src/persistence/get.rs
+++ b/55e35dba/src/persistence/get.rs
@@ -42,0 +43 @@ pub fn get_all_bookmarks(pool: &Pool<Sqlite>) -> Result<Vec<SavedBookmark>, DBEr
+fn literal_like_substring_pattern(value: &str) -> String
@@ -45,0 +47 @@ fn getting_matching_bookmark_uris_by_pattern_uses_union_semantics()
+fn get_matching_bookmark_uris_treats_like_metacharacters_literally()
@@ -50,0 +53 @@ fn getting_bookmarks_by_uri_only_works()
+fn bookmark_filters_treat_like_metacharacters_literally()
@@ -63,0 +67 @@ fn getting_tags_with_stats_works()
+fn literal_like_substring_pattern_escapes_like_metacharacters()
diff --git a/71f75b64/tests/delete_test.rs b/55e35dba/tests/delete_test.rs
index 322aa86..b8258b2 100644
--- a/71f75b64/tests/delete_test.rs
+++ b/55e35dba/tests/delete_test.rs
@@ -4,0 +5 @@ fn deleting_bookmarks_by_multiple_patterns_works()
+fn deleting_by_pattern_treats_like_metacharacters_literally()
diff --git a/71f75b64/tests/list_test.rs b/55e35dba/tests/list_test.rs
index b2a135f..8c9d94a 100644
--- a/71f75b64/tests/list_test.rs
+++ b/55e35dba/tests/list_test.rs
@@ -2,0 +3 @@ fn listing_bookmarks_with_queries_works()
+fn listing_by_uri_treats_like_metacharacters_literally() |
|
@coderabbitai review |
✅ Action performedReview finished.
|
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (6)
Included review availability: Your plan includes up to 2 reviews per rolling hour; 1 remains after this review. 📝 WalkthroughWalkthroughSQLite Merge Risk: ⚪ Minimal · up to The change makes user-provided URI, title, and search values match as literal substrings while preserving normal wildcard behavior. No actionable merge-blocking risk remains beyond normal checks and review. 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Treat user-provided URI, title, and search values as literal substrings in SQL LIKE queries. Escape LIKE metacharacters while retaining the surrounding substring wildcards, preserving ordinary matching and bound parameters while preventing unintended matches during pattern deletion.
Implements #155.