- How you use it
- You ask for it
- What it can do
- installs software · writes files · network · runs shell
- What's inside
The option
| Option | ASkill · v1.0.0Scan a TS project for Drizzle 1.0 RC changes |
|---|---|
| How you use it | You ask for it |
| What it can do | installs software · writes files · network · runs shell |
| What's inside |
What this thread does
First import the optional-filter sentinel: import { EmptyFilter } from 'drizzle-orm/relations';. For an intentionally optional boolean, use isActive: params.isActive ?? EmptyFilter. Reject missing required identity inputs instead; then review relation-presence filters and postgres-js serialization workarounds before rollout.
What changed
- Drizzle 1.0.0-rc.5, released 2026-10-21 (checked 2026-10-28), rejects
undefinedin relationalwherefields and introducesEmptyFilterfor intentional omission. - In that same release and date (checked 2026-10-28), empty relation conditions stop checking for related rows; use booleans for presence or absence. The postgres-js serializer repair also requires removing manual JSON serialization workarounds. Official breaking-change notes.
How to migrate
1. Pin the intended drizzle-orm RC (version above, checked 2026-10-28). Inventory relational builders and raw postgres-js calls; read the full release before choosing the rest of your upgrade scope. 2. Reject missing identity inputs before querying. For intentionally optional inputs, import EmptyFilter from drizzle-orm/relations; the release example is db.query.users.findMany({ where: { isActive: params.isActive ?? EmptyFilter } }). Avoid this fallback for authorization predicates. 3. Change where: { posts: {} } to where: { posts: true } for presence or where: { posts: false } for absence. Review builders that assemble empty nested conditions. 4. Remove workaround-only JSON.stringify(jsonValue) from raw SQL/driver calls. Bind JSON arrays with sql.param(jsonArrayValue). Retain intentional serialization for HTTP, files and text columns. 5. Compare raw-driver and ORM fixtures before deploying. For nested relational callbacks, follow Drizzle Queries: use the callback's aliased table rather than an imported table reference.
What breaks
Diagnostic: undefined in relational where filters
The release specifies that this throws, but does not publish a canonical exception message; match the input and call site instead of a guessed error string.
Expect rejected optional-filter builders, broader results from empty relation conditions, or double-encoded JSON if the old workaround remains. Review query and serialization behavior before changing migration history.
What to test
| Fixture | Assertion to add |
|---|---|
| Required token or tenant ID is absent | Request is rejected before a database query; no fallback session or tenant is selected |
| Optional boolean is false, true or absent | Both booleans remain filters; only intentional absence removes the condition |
| Parent has no children, one child or several | Presence and absence conditions return the intended parent IDs |
| Raw JSON object and JSON array | Round trip preserves object/array shape and values rather than returning a serialized string |
| Same driver shared with raw calls | Compare direct-driver and ORM paths for JSON and temporal fields |
These are proposed regression checks; no fixture was run here. Include malformed inputs in tests instead of relying solely on TypeScript types.
Pitfalls
Do not use EmptyFilter to hide a missing authorization value. Do not replace a boolean fallback with truthiness: false is a valid filter value. Do not globally delete JSON.stringify. Check that an empty nested object was truly intended to mean no restriction. If a relation's SQL alias becomes unreachable after this upgrade, inspect the additional query-strategy breaking changes in the release notes.
Community evidence
- In issue #5636, irisarco reports that an absent token caused a session lookup to select an arbitrary row; a commenter confirms reliance on optional filtering. The author's phrase, “return a random session,” describes the historical risk, not a result I reproduced.
- In issue #3171, camc314 supplies a raw SQL JSON-object reproduction; the reported error ends “Received an instance of Object” The release explicitly links this issue to the driver repair. The report predates this RC and does not prove every workaround can safely be deleted.
A prompt to give your agent
Your training data predates this release. Read the linked official Drizzle release notes and query documentation; do not guess an error message or migration command. Inspect relational where builders and raw postgres-js JSON calls. Classify each missing input as required identity or intentionally optional. Propose a small diff for explicit omission, relation presence/absence and workaround removal. Add fixture assertions for tenant isolation, false booleans, empty relations, JSON arrays and temporal values. Do not connect to a database or change migration history.
Limits
Checked 2026-10-28. No package installation, query execution, migration or driver round trip was performed. Two real user issues explain the failure modes; independent reports confirming this RC's fixes remain thin. This is a focused subset of a larger breaking release. Prices and licences were not compared.
Started from a post by @AlexBlokh, packaged by the editor. Original post
- 01 · YouPaste the line from Try it into your agent.
- 02 · Your agentGets the package and a trial ticket, installs it on a new branch, runs its check.
- 03 · YouApprove a one-line report. Nothing is posted without you.