zenstack/packages/language/test
ymc9 8f70f17d94 feat(orm): add field-level @fuzzy attribute to gate fuzzy search
Adds a new ZModel field-level `@fuzzy` attribute that opts a `String` field
into fuzzy search. Without `@fuzzy`, the `fuzzy` filter operator and
`_fuzzyRelevance` orderBy are unavailable both at the type level and at runtime.

- Language: declare `@fuzzy` in stdlib (StringField only, @@@once)
- Validator: enforce postgres-only via shared `getDataSourceProvider` helper
- Schema: surface `fuzzy?: boolean` on `FieldDef`; generator emits it
- ORM types: gate `fuzzy:` filter and `_fuzzyRelevance.fields` to opted-in fields
- Zod factory: thread `withFuzzy` through string filter; filter `_fuzzyRelevance` enum
- Runtime: throw `InvalidInputError` when fuzzy is used on non-`@fuzzy` fields
- Tests: dedicated `fuzzy-search` test schema; validator coverage for postgres/sqlite/mysql/non-String

Breaking: existing schemas using fuzzy search must annotate fields with
`@fuzzy` to retain access. Fuzzy search shipped only one PR ago (#2573).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-03 20:45:40 -07:00
..
attribute-application.test.ts feat(orm): add field-level @fuzzy attribute to gate fuzzy search 2026-05-03 20:45:40 -07:00
delegate.test.ts fix(zmodel): rejects delegate models with missing opposite relation (#490) 2025-12-14 10:23:00 +08:00
expression-validation.test.ts feat(zmodel): collection predicate binding (#548) 2026-01-18 14:08:10 +08:00
function-invocation.test.ts fix(orm): cuid() generator should respect version argument (#547) 2025-12-29 23:18:35 +08:00
import.test.ts fix(policy): run pg/sqlite tests, misc dual db compatibility fixes (#260) 2025-09-22 16:16:15 -07:00
mixin.test.ts feat(language): allow relation fields in type declarations for mixin use cases (#2583) 2026-04-16 20:01:12 -07:00
procedure-validation.test.ts custom procedures (#551) 2026-01-08 11:21:51 +08:00
this-resolution.test.ts test(zmodel): more validation tests (#459) 2025-12-02 10:27:11 +08:00
utils.ts refactor: move policy attributes to its own zmodel (#307) 2025-10-16 21:52:22 -07:00
view.test.ts fix(zmodel): more validation about "view" (#526) 2025-12-23 12:40:17 +08:00