Skip to content

feat(query): positional where() args and attribute-typed autocompletion#35

Merged
3m1n3nc3 merged 1 commit into
mainfrom
feat/where-positional-args-and-typing
Jul 9, 2026
Merged

feat(query): positional where() args and attribute-typed autocompletion#35
3m1n3nc3 merged 1 commit into
mainfrom
feat/where-positional-args-and-typing

Conversation

@3m1n3nc3

@3m1n3nc3 3m1n3nc3 commented Jul 9, 2026

Copy link
Copy Markdown
Member
  • where()/orWhere() now accept positional forms in addition to objects, callbacks, and expressions: where(column, value), where(column, operator, value), and the unary where(column, 'is-null' | 'is-not-null'). '<>' and '==' are normalized to '!=' and '='. The column is typed to the model's attributes (autocompletes and rejects unknown columns).
  • Add ModelWhereInput as the primary object overload so the where-object keys autocomplete from the model's declared attributes instead of resolving to a loose, any-typed input. The Prisma-delegate QuerySchemaWhere overload is retained for compatibility.

Tests: positional behavior (equality/operator/unary/aliases, AND+OR mixing) and
type-level assertions for column typing. Docs: filtering section.

- where()/orWhere() now accept positional forms in addition to objects,
  callbacks, and expressions: where(column, value), where(column, operator,
  value), and the unary where(column, 'is-null' | 'is-not-null'). '<>' and '=='
  are normalized to '!=' and '='. The column is typed to the model's attributes
  (autocompletes and rejects unknown columns).
- Add ModelWhereInput<TModel> as the primary object overload so the where-object
  keys autocomplete from the model's declared attributes instead of resolving to
  a loose, any-typed input. The Prisma-delegate QuerySchemaWhere overload is
  retained for compatibility.

Tests: positional behavior (equality/operator/unary/aliases, AND+OR mixing) and
type-level assertions for column typing. Docs: filtering section.
@codecov

codecov Bot commented Jul 9, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 97.29730% with 1 line in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
src/QueryBuilder.ts 97.29% 1 Missing ⚠️

📢 Thoughts on this report? Let us know!

@3m1n3nc3 3m1n3nc3 merged commit 9bc85b4 into main Jul 9, 2026
7 checks passed
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.

1 participant