Skip to content

feat(pinia-orm): add whereLike & orWhereLike query methods#2034

Merged
CodeDredd merged 1 commit into
mainfrom
feat/where-like
Jul 20, 2026
Merged

feat(pinia-orm): add whereLike & orWhereLike query methods#2034
CodeDredd merged 1 commit into
mainfrom
feat/where-like

Conversation

@CodeDredd

@CodeDredd CodeDredd commented Jul 19, 2026

Copy link
Copy Markdown
Owner

Feature (#1692)

Laravel-style whereLike / orWhereLike on query & repository:

useRepo(Project).whereLike('name', `%${query}%`).get()
useRepo(User).whereLike('name', 'John%', true).get() // case sensitive
  • % matches any number of characters, _ exactly one — pattern is compiled to an anchored RegExp with all other characters escaped.
  • Case insensitive by default, opt-in case sensitivity via third argument (same semantics as Laravel's whereLike).
  • null/undefined field values never match.
  • Non-string fields are stringified before matching (whereLike('age', '3%')).
  • New docs page api/query/where-like.

Tests

7 new tests: contains/starts-with patterns, case sensitivity, _ wildcard, no-wildcard equality, orWhereLike, numeric fields. Full suite green.

closes #1692

SQL LIKE style filtering with % and _ wildcards, case insensitive by
default like Laravel's whereLike. Available on query and repository.

closes #1692
@codecov-commenter

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 92.85714% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 99.37%. Comparing base (018acee) to head (759e975).
⚠️ Report is 2 commits behind head on main.

Files with missing lines Patch % Lines
packages/pinia-orm/src/support/Utils.ts 87.50% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2034      +/-   ##
==========================================
- Coverage   99.40%   99.37%   -0.04%     
==========================================
  Files          82       82              
  Lines        3025     3039      +14     
  Branches      533      537       +4     
==========================================
+ Hits         3007     3020      +13     
- Misses         15       16       +1     
  Partials        3        3              

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@CodeDredd CodeDredd mentioned this pull request Jul 19, 2026
2 tasks
@CodeDredd
CodeDredd merged commit b5c50ab into main Jul 20, 2026
10 of 13 checks passed
@CodeDredd
CodeDredd deleted the feat/where-like branch July 20, 2026 15:06
@github-actions github-actions Bot mentioned this pull request Jul 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature Request] whereLike

2 participants