`to_tsvector(NULL)` returns NULL and `ts_rank(NULL, ...)` therefore
returns NULL — under Postgres's default `NULLS FIRST` for `ORDER BY DESC`
this would surface NULL-valued rows ahead of any matching ones, an
asymmetry with the multi-field path where `concat_ws(' ', ...)` already
skips NULLs and yields a 0.0 rank. Coalescing the field to `''` aligns
the two paths.
Adds `subtitle: String? @fullText` to the test fixture and a regression
test that orders a NULL-subtitle row against a matching one — without
the fix, the NULL row ranks first under DESC.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Introduces a Prisma-style full-text search capability gated by a new
field-level `@fullText` ZModel attribute. PostgreSQL only — MySQL/SQLite
throw NotSupported. Mirrors the existing `@fuzzy` design.
- Filter operator: `where: { title: { fts: { search, config? } } }`
emits `to_tsvector(field) @@ to_tsquery(query)` (or with a `::regconfig`
cast when `config` is provided; otherwise Postgres uses the database's
`default_text_search_config`).
- OrderBy operator: `_ftsRelevance: { fields, search, config?, sort }`
emits a single `ts_rank(...)`. Multi-field combines fields with
`concat_ws(' ', ...)` so AND queries match terms across fields
(matches Prisma's behavior).
- Type-level gating: the `fts` operator and `_ftsRelevance` orderBy
appear only on String fields annotated with `@fullText` and only when
the schema's provider is `postgresql`. Slicing's `'FullText'` filter
kind controls availability of the runtime operator.
- Cursor pagination is rejected when combined with `_ftsRelevance`
(parallel to `_fuzzyRelevance`).
Also refactors `buildOrderBy` to dispatch to small per-branch helpers
(`applyScalarOrderBy`, `applyAggregationOrderBy`, `applyRelationOrderBy`,
`applyFuzzyRelevanceOrderBy`, `applyFtsRelevanceOrderBy`).
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Adds `pnpm test:generate` to the build scripts of @zenstackhq/orm,
@zenstackhq/schema, and @zenstackhq/zod so test fixtures are
regenerated as part of `pnpm build`. Includes the resulting
regeneration of packages/schema/test/schema/schema.ts.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Register SuperJSON custom serializers for the three JSON null sentinels in
both the client-helpers fetch layer and the server's registerCustomSerializers,
so they survive HTTP round-trips when used as query filters or mutation input.
Re-export the singletons from all tanstack-query framework entry points
(react, vue, svelte) for convenient user access.
Fixes#2278
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- ZodSchemaFactory.toJSONSchema() now skips makeProcedureArgsSchema for
procedures excluded by slicing (includedProcedures / excludedProcedures),
preventing dangling component registrations for hidden procedures
- RPCApiSpecGenerator.generateSharedSchemas() now emits enum schemas so
$ref pointers from model entity schemas and typedef schemas resolve correctly
- RPCApiSpecGenerator requestBody.required is now only set when at least one
procedure param is non-optional, matching the existing GET q-param behavior
- Add tests covering all three fixes
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>