Conversation
Co-authored-by: ymc9 <104139426+ymc9@users.noreply.github.com>
* refactor(orm): simplify model results typing * add missing dev dependency * update * update * update
WalkthroughThis PR bumps the package version to 3.0.0-beta.29 and refactors the ORM type layer by replacing Changes
Estimated code review effort🎯 4 (Complex) | ⏱️ ~75 minutes
Areas requiring extra attention during review:
Possibly related PRs
Poem
Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
Claude finished @ymc9's task —— View job PR Review: v3.0.0-beta.29 ReleaseReview Progress:
🎯 SummaryThis is a solid release that primarily focuses on type system improvements and ORM client enhancements. The changes appear well-structured and maintain backwards compatibility while introducing beneficial type safety improvements. 🔍 Key Changes Reviewed✅ Type System Improvements (Commit ac4a68c)
✅ Client Options Enhancement
✅ TanStack Query Integration
🛡️ Security Assessment✅ SQL Injection Protection:
✅ No security regressions detected ⚡ Performance Considerations✅ Type-only changes: Most modifications are compile-time improvements without runtime overhead 🔧 Code QualityStrengths:
Areas to Watch:
🧪 Testing & Compatibility✅ Test coverage: 220 test files maintained 📋 Minor Issues Identified
✅ Final RecommendationAPPROVED - This is a well-executed type system improvement that enhances developer experience without introducing security risks or breaking changes. The changes are focused, well-tested, and maintain the existing API surface. Key Benefits:
The PR is ready for merge to main for the v3.0.0-beta.29 release. |
There was a problem hiding this comment.
Actionable comments posted: 0
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
tests/e2e/orm/client-api/transaction.test.ts (1)
6-6: Fix the incorrect test suite description.The test suite is described as "Client raw query tests" but this file contains transaction tests, not raw query tests. This appears to be a copy-paste error.
Apply this diff to correct the description:
-describe('Client raw query tests', () => { +describe('Client transaction tests', () => {
🧹 Nitpick comments (4)
packages/clients/tanstack-query/test/schemas/basic/schema-lite.ts (1)
9-171: Consider addingreadonlymodifiers to schema properties.The class properties (
provider,models,authType,plugins) are not marked asreadonly, which allows them to be reassigned at runtime (e.g.,schema.authType = "Post"). For schema definitions that should remain immutable after instantiation, addingreadonlywould prevent accidental mutations and make the design intent clearer.Note: Since this is a generated file, this suggestion applies to the code generator rather than this file directly.
Example:
export class SchemaType implements SchemaDef { - provider = { + readonly provider = { type: "sqlite" } as const; - models = { + readonly models = { ... } as const; - authType = "User" as const; - plugins = {}; + readonly authType = "User" as const; + readonly plugins = {}; }tests/e2e/orm/client-api/update.test.ts (1)
10-12: Good cleanup, but it’s still effectivelyany-typed.Dropping the cast is nice, but since
createTestClientreturnsPromise<any>, TS still won’t validateClientContract<typeof schema>here. Consider typingcreateTestClientgenerically (e.g.,Promise<ClientContract<TSchema>>) if the goal is stricter tests. Based on learnings, keep client API tests comprehensive.packages/orm/src/client/options.ts (1)
148-156: Avoid duplicatedPick<..., 'omit'>to prevent drift.Suggest centralizing the selected keys so
QueryOptionsandToQueryOptionscan’t diverge later:/** * Subset of client options relevant to query operations. */ -export type QueryOptions<Schema extends SchemaDef> = Pick<ClientOptions<Schema>, 'omit'>; +type QueryOptionKeys = 'omit'; +export type QueryOptions<Schema extends SchemaDef> = Pick<ClientOptions<Schema>, QueryOptionKeys>; /** * Extract QueryOptions from ClientOptions */ -export type ToQueryOptions<T extends ClientOptions<any>> = Pick<T, 'omit'>; +export type ToQueryOptions<T extends ClientOptions<any>> = Pick<T, QueryOptionKeys>;Based on learnings, keeping this layer crisp helps with hook interception/customization surfaces downstream.
packages/orm/src/client/crud-types.ts (1)
124-132: Consider removing or updating commented-out code.The commented-out
DelegateUnionResulttype at lines 124-132 references the old type signature pattern but has been updated to useQueryOptions. If this code is planned for future implementation, consider adding a TODO comment with context. If it's obsolete, consider removing it to reduce maintenance burden.
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (1)
pnpm-lock.yamlis excluded by!**/pnpm-lock.yaml
📒 Files selected for processing (74)
package.json(1 hunks)packages/auth-adapters/better-auth/package.json(1 hunks)packages/cli/package.json(1 hunks)packages/clients/tanstack-query/package.json(3 hunks)packages/clients/tanstack-query/src/react.ts(4 hunks)packages/clients/tanstack-query/src/svelte.ts(4 hunks)packages/clients/tanstack-query/src/vue.ts(4 hunks)packages/clients/tanstack-query/test/schemas/basic/input.ts(6 hunks)packages/clients/tanstack-query/test/schemas/basic/schema-lite.ts(2 hunks)packages/common-helpers/package.json(1 hunks)packages/config/eslint-config/package.json(1 hunks)packages/config/typescript-config/package.json(1 hunks)packages/config/vitest-config/package.json(1 hunks)packages/create-zenstack/package.json(1 hunks)packages/language/package.json(1 hunks)packages/orm/package.json(1 hunks)packages/orm/src/client/contract.ts(16 hunks)packages/orm/src/client/crud-types.ts(8 hunks)packages/orm/src/client/crud/dialects/sqlite.ts(2 hunks)packages/orm/src/client/options.ts(1 hunks)packages/plugins/policy/package.json(1 hunks)packages/schema/package.json(1 hunks)packages/sdk/package.json(1 hunks)packages/sdk/src/ts-schema-generator.ts(4 hunks)packages/server/package.json(1 hunks)packages/testtools/package.json(1 hunks)packages/zod/package.json(1 hunks)samples/next.js/package.json(1 hunks)samples/next.js/zenstack/input.ts(3 hunks)samples/orm/package.json(1 hunks)samples/orm/zenstack/input.ts(4 hunks)scripts/test-generate.ts(1 hunks)tests/e2e/apps/rally/zenstack/input.ts(28 hunks)tests/e2e/github-repos/formbricks/input.ts(36 hunks)tests/e2e/github-repos/trigger.dev/input.ts(52 hunks)tests/e2e/orm/client-api/aggregate.test.ts(1 hunks)tests/e2e/orm/client-api/count.test.ts(1 hunks)tests/e2e/orm/client-api/create-many-and-return.test.ts(1 hunks)tests/e2e/orm/client-api/create-many.test.ts(1 hunks)tests/e2e/orm/client-api/create.test.ts(1 hunks)tests/e2e/orm/client-api/delete-many.test.ts(1 hunks)tests/e2e/orm/client-api/delete.test.ts(1 hunks)tests/e2e/orm/client-api/find.test.ts(1 hunks)tests/e2e/orm/client-api/group-by.test.ts(1 hunks)tests/e2e/orm/client-api/raw-query.test.ts(1 hunks)tests/e2e/orm/client-api/transaction.test.ts(1 hunks)tests/e2e/orm/client-api/undefined-values.test.ts(1 hunks)tests/e2e/orm/client-api/update-many.test.ts(1 hunks)tests/e2e/orm/client-api/update.test.ts(1 hunks)tests/e2e/orm/plugin-infra/on-kysely-query.test.ts(1 hunks)tests/e2e/orm/plugin-infra/on-query-hooks.test.ts(1 hunks)tests/e2e/orm/policy/basic-schema-read.test.ts(1 hunks)tests/e2e/orm/policy/policy-functions.test.ts(0 hunks)tests/e2e/orm/schemas/auth-type/input.ts(2 hunks)tests/e2e/orm/schemas/basic/input.ts(5 hunks)tests/e2e/orm/schemas/default-auth/input.ts(4 hunks)tests/e2e/orm/schemas/delegate/input.ts(8 hunks)tests/e2e/orm/schemas/json/input.ts(2 hunks)tests/e2e/orm/schemas/name-mapping/input.ts(3 hunks)tests/e2e/orm/schemas/omit/input.ts(5 hunks)tests/e2e/orm/schemas/petstore/input.ts(4 hunks)tests/e2e/orm/schemas/todo/input.ts(6 hunks)tests/e2e/orm/schemas/todo/schema.ts(2 hunks)tests/e2e/orm/schemas/typed-json/input.ts(2 hunks)tests/e2e/orm/schemas/typing/input.ts(7 hunks)tests/e2e/package.json(1 hunks)tests/regression/package.json(1 hunks)tests/regression/test/issue-204/input.ts(2 hunks)tests/regression/test/issue-204/schema.ts(4 hunks)tests/regression/test/issue-422/input.ts(4 hunks)tests/runtimes/bun/package.json(1 hunks)tests/runtimes/bun/schemas/input.ts(3 hunks)tests/runtimes/edge-runtime/package.json(1 hunks)tests/runtimes/edge-runtime/schemas/input.ts(3 hunks)
💤 Files with no reviewable changes (1)
- tests/e2e/orm/policy/policy-functions.test.ts
🧰 Additional context used
📓 Path-based instructions (1)
tests/e2e/**/*.{ts,tsx}
📄 CodeRabbit inference engine (CLAUDE.md)
E2E tests should validate real-world schema compatibility with established projects
Files:
tests/e2e/orm/policy/basic-schema-read.test.tstests/e2e/orm/client-api/delete.test.tstests/e2e/orm/client-api/find.test.tstests/e2e/orm/client-api/create-many-and-return.test.tstests/e2e/orm/plugin-infra/on-query-hooks.test.tstests/e2e/orm/client-api/transaction.test.tstests/e2e/orm/client-api/update.test.tstests/e2e/orm/client-api/raw-query.test.tstests/e2e/orm/client-api/update-many.test.tstests/e2e/orm/client-api/delete-many.test.tstests/e2e/orm/client-api/group-by.test.tstests/e2e/orm/client-api/count.test.tstests/e2e/orm/client-api/create.test.tstests/e2e/orm/client-api/create-many.test.tstests/e2e/orm/client-api/undefined-values.test.tstests/e2e/orm/client-api/aggregate.test.tstests/e2e/orm/plugin-infra/on-kysely-query.test.tstests/e2e/orm/schemas/todo/schema.tstests/e2e/orm/schemas/auth-type/input.tstests/e2e/github-repos/trigger.dev/input.tstests/e2e/orm/schemas/todo/input.tstests/e2e/orm/schemas/typed-json/input.tstests/e2e/orm/schemas/basic/input.tstests/e2e/orm/schemas/default-auth/input.tstests/e2e/orm/schemas/omit/input.tstests/e2e/orm/schemas/typing/input.tstests/e2e/orm/schemas/delegate/input.tstests/e2e/orm/schemas/petstore/input.tstests/e2e/orm/schemas/name-mapping/input.tstests/e2e/orm/schemas/json/input.tstests/e2e/github-repos/formbricks/input.tstests/e2e/apps/rally/zenstack/input.ts
🧠 Learnings (14)
📓 Common learnings
Learnt from: CR
Repo: zenstackhq/zenstack-v3 PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-11-26T01:55:04.540Z
Learning: Applies to packages/zenstackhq/orm/**/*.{ts,tsx} : Implement plugin hooks at ORM, Kysely, and entity mutation levels for query interception and customization
Learnt from: CR
Repo: zenstackhq/zenstack-v3 PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-11-26T01:55:04.540Z
Learning: Applies to packages/zenstackhq/orm/**/*.{ts,tsx} : Use Kysely as the query builder interface for low-level database queries, avoiding raw SQL when possible
Learnt from: CR
Repo: zenstackhq/zenstack-v3 PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-11-26T01:55:04.540Z
Learning: Applies to packages/zenstackhq/orm/**/*.test.{ts,tsx} : ORM package tests should include comprehensive client API tests and policy tests
📚 Learning: 2025-11-26T01:55:04.540Z
Learnt from: CR
Repo: zenstackhq/zenstack-v3 PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-11-26T01:55:04.540Z
Learning: Applies to packages/zenstackhq/orm/**/*.test.{ts,tsx} : ORM package tests should include comprehensive client API tests and policy tests
Applied to files:
tests/e2e/orm/policy/basic-schema-read.test.tstests/e2e/orm/client-api/delete.test.tstests/e2e/orm/client-api/find.test.tspackages/orm/package.jsontests/e2e/orm/client-api/create-many-and-return.test.tstests/e2e/orm/plugin-infra/on-query-hooks.test.tstests/e2e/orm/client-api/transaction.test.tstests/e2e/orm/client-api/update.test.tstests/e2e/orm/client-api/raw-query.test.tstests/e2e/orm/client-api/update-many.test.tstests/e2e/orm/client-api/delete-many.test.tstests/e2e/orm/client-api/group-by.test.tstests/e2e/orm/client-api/count.test.tstests/e2e/orm/client-api/create.test.tstests/e2e/orm/client-api/create-many.test.tstests/e2e/orm/client-api/undefined-values.test.tstests/e2e/orm/client-api/aggregate.test.tstests/e2e/orm/plugin-infra/on-kysely-query.test.tstests/e2e/orm/schemas/auth-type/input.tspackages/orm/src/client/contract.tstests/e2e/github-repos/trigger.dev/input.tstests/regression/test/issue-204/input.tstests/e2e/orm/schemas/todo/input.tstests/e2e/orm/schemas/typed-json/input.tstests/e2e/orm/schemas/basic/input.tspackages/sdk/src/ts-schema-generator.tstests/runtimes/edge-runtime/schemas/input.tstests/e2e/orm/schemas/default-auth/input.tspackages/orm/src/client/crud-types.tstests/runtimes/bun/schemas/input.tspackages/clients/tanstack-query/test/schemas/basic/input.tstests/e2e/orm/schemas/omit/input.tstests/e2e/orm/schemas/typing/input.tstests/e2e/orm/schemas/delegate/input.tssamples/orm/zenstack/input.tssamples/next.js/zenstack/input.tstests/regression/test/issue-422/input.tstests/e2e/orm/schemas/petstore/input.tstests/e2e/orm/schemas/name-mapping/input.tstests/e2e/orm/schemas/json/input.tstests/e2e/github-repos/formbricks/input.tstests/e2e/apps/rally/zenstack/input.ts
📚 Learning: 2025-11-26T01:55:04.540Z
Learnt from: CR
Repo: zenstackhq/zenstack-v3 PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-11-26T01:55:04.540Z
Learning: Applies to tests/e2e/**/*.{ts,tsx} : E2E tests should validate real-world schema compatibility with established projects
Applied to files:
tests/e2e/orm/policy/basic-schema-read.test.tstests/e2e/orm/client-api/delete.test.tstests/e2e/orm/client-api/find.test.tstests/e2e/orm/client-api/create-many-and-return.test.tstests/e2e/package.jsontests/e2e/orm/plugin-infra/on-query-hooks.test.tstests/e2e/orm/client-api/transaction.test.tstests/e2e/orm/client-api/update.test.tstests/e2e/orm/client-api/raw-query.test.tstests/e2e/orm/client-api/update-many.test.tstests/e2e/orm/client-api/delete-many.test.tstests/e2e/orm/client-api/group-by.test.tstests/e2e/orm/client-api/count.test.tstests/e2e/orm/client-api/create.test.tstests/e2e/orm/client-api/create-many.test.tstests/e2e/orm/client-api/undefined-values.test.tstests/e2e/orm/client-api/aggregate.test.tstests/e2e/orm/plugin-infra/on-kysely-query.test.tstests/e2e/orm/schemas/todo/schema.tstests/e2e/orm/schemas/auth-type/input.tspackages/clients/tanstack-query/test/schemas/basic/schema-lite.tstests/e2e/orm/schemas/todo/input.tstests/e2e/orm/schemas/typed-json/input.tstests/e2e/orm/schemas/basic/input.tstests/e2e/orm/schemas/default-auth/input.tstests/regression/test/issue-204/schema.tstests/runtimes/bun/schemas/input.tstests/e2e/orm/schemas/omit/input.tstests/e2e/orm/schemas/typing/input.tstests/e2e/orm/schemas/delegate/input.tstests/e2e/orm/schemas/petstore/input.tstests/e2e/orm/schemas/name-mapping/input.tstests/e2e/orm/schemas/json/input.tstests/e2e/github-repos/formbricks/input.tstests/e2e/apps/rally/zenstack/input.ts
📚 Learning: 2025-11-26T01:55:04.540Z
Learnt from: CR
Repo: zenstackhq/zenstack-v3 PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-11-26T01:55:04.540Z
Learning: Applies to **/*.zmodel : ZModel schema files should define database structure and policies that compile to TypeScript via `zenstack generate`
Applied to files:
packages/schema/package.jsonpackages/language/package.jsonpackages/zod/package.jsonscripts/test-generate.tstests/e2e/orm/schemas/todo/schema.tstests/e2e/orm/schemas/auth-type/input.tspackages/clients/tanstack-query/test/schemas/basic/schema-lite.tspackages/orm/src/client/contract.tstests/e2e/github-repos/trigger.dev/input.tstests/regression/test/issue-204/input.tstests/e2e/orm/schemas/typed-json/input.tstests/e2e/orm/schemas/basic/input.tspackages/sdk/src/ts-schema-generator.tstests/runtimes/edge-runtime/schemas/input.tstests/e2e/orm/schemas/default-auth/input.tspackages/orm/src/client/crud-types.tstests/regression/test/issue-204/schema.tstests/runtimes/bun/schemas/input.tspackages/clients/tanstack-query/test/schemas/basic/input.tstests/e2e/orm/schemas/omit/input.tstests/e2e/orm/schemas/typing/input.tstests/e2e/orm/schemas/delegate/input.tssamples/orm/zenstack/input.tssamples/next.js/zenstack/input.tstests/e2e/orm/schemas/petstore/input.tstests/e2e/orm/schemas/name-mapping/input.tstests/e2e/orm/schemas/json/input.tstests/e2e/github-repos/formbricks/input.tstests/e2e/apps/rally/zenstack/input.ts
📚 Learning: 2025-11-26T01:55:04.540Z
Learnt from: CR
Repo: zenstackhq/zenstack-v3 PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-11-26T01:55:04.540Z
Learning: Applies to packages/zenstackhq/orm/**/*.{ts,tsx} : Implement plugin hooks at ORM, Kysely, and entity mutation levels for query interception and customization
Applied to files:
tests/e2e/orm/client-api/delete.test.tspackages/orm/package.jsontests/e2e/orm/client-api/create-many-and-return.test.tstests/e2e/orm/plugin-infra/on-query-hooks.test.tstests/e2e/orm/client-api/update.test.tstests/e2e/orm/client-api/raw-query.test.tspackages/orm/src/client/options.tstests/e2e/orm/client-api/delete-many.test.tstests/e2e/orm/client-api/count.test.tstests/e2e/orm/client-api/create.test.tstests/e2e/orm/client-api/create-many.test.tstests/e2e/orm/client-api/undefined-values.test.tstests/e2e/orm/plugin-infra/on-kysely-query.test.tspackages/orm/src/client/crud/dialects/sqlite.tstests/e2e/orm/schemas/auth-type/input.tspackages/orm/src/client/contract.tstests/e2e/github-repos/trigger.dev/input.tstests/regression/test/issue-204/input.tstests/e2e/orm/schemas/todo/input.tstests/e2e/orm/schemas/typed-json/input.tstests/e2e/orm/schemas/basic/input.tspackages/sdk/src/ts-schema-generator.tstests/runtimes/edge-runtime/schemas/input.tspackages/clients/tanstack-query/src/react.tstests/e2e/orm/schemas/default-auth/input.tspackages/orm/src/client/crud-types.tstests/runtimes/bun/schemas/input.tspackages/clients/tanstack-query/test/schemas/basic/input.tspackages/clients/tanstack-query/src/svelte.tspackages/clients/tanstack-query/src/vue.tstests/e2e/orm/schemas/omit/input.tstests/e2e/orm/schemas/typing/input.tstests/e2e/orm/schemas/delegate/input.tssamples/orm/zenstack/input.tssamples/next.js/zenstack/input.tstests/regression/test/issue-422/input.tstests/e2e/orm/schemas/petstore/input.tstests/e2e/orm/schemas/name-mapping/input.tstests/e2e/orm/schemas/json/input.tstests/e2e/github-repos/formbricks/input.tstests/e2e/apps/rally/zenstack/input.ts
📚 Learning: 2025-11-26T01:55:04.540Z
Learnt from: CR
Repo: zenstackhq/zenstack-v3 PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-11-26T01:55:04.540Z
Learning: Applies to packages/zenstackhq/orm/**/*.{ts,tsx} : Use Kysely as the query builder interface for low-level database queries, avoiding raw SQL when possible
Applied to files:
tests/e2e/orm/client-api/find.test.tspackages/orm/package.jsontests/e2e/orm/plugin-infra/on-query-hooks.test.tstests/e2e/orm/client-api/raw-query.test.tspackages/orm/src/client/options.tstests/e2e/orm/plugin-infra/on-kysely-query.test.tspackages/orm/src/client/crud/dialects/sqlite.tstests/e2e/orm/schemas/auth-type/input.tspackages/orm/src/client/contract.tstests/e2e/github-repos/trigger.dev/input.tstests/regression/test/issue-204/input.tstests/e2e/orm/schemas/todo/input.tstests/e2e/orm/schemas/typed-json/input.tstests/e2e/orm/schemas/basic/input.tspackages/sdk/src/ts-schema-generator.tstests/runtimes/edge-runtime/schemas/input.tspackages/clients/tanstack-query/src/react.tstests/e2e/orm/schemas/default-auth/input.tspackages/orm/src/client/crud-types.tstests/runtimes/bun/schemas/input.tspackages/clients/tanstack-query/test/schemas/basic/input.tspackages/clients/tanstack-query/src/svelte.tspackages/clients/tanstack-query/src/vue.tstests/e2e/orm/schemas/omit/input.tstests/e2e/orm/schemas/typing/input.tstests/e2e/orm/schemas/delegate/input.tssamples/orm/zenstack/input.tssamples/next.js/zenstack/input.tstests/regression/test/issue-422/input.tstests/e2e/orm/schemas/petstore/input.tstests/e2e/orm/schemas/name-mapping/input.tstests/e2e/orm/schemas/json/input.tstests/e2e/github-repos/formbricks/input.tstests/e2e/apps/rally/zenstack/input.ts
📚 Learning: 2025-11-26T01:55:04.540Z
Learnt from: CR
Repo: zenstackhq/zenstack-v3 PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-11-26T01:55:04.540Z
Learning: Applies to ide/vscode/**/{package.json,version.ts} : The VSCode IDE extension package should maintain a different version from other packages to comply with VSCode Marketplace requirements
Applied to files:
packages/config/typescript-config/package.jsonpackage.json
📚 Learning: 2025-11-26T01:55:04.540Z
Learnt from: CR
Repo: zenstackhq/zenstack-v3 PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-11-26T01:55:04.540Z
Learning: Applies to tests/**/type*.{ts,tsx} : Ensure TypeScript inference and type coverage are validated through type coverage tests
Applied to files:
tests/e2e/orm/client-api/undefined-values.test.tspackages/clients/tanstack-query/package.json
📚 Learning: 2025-11-26T01:55:04.540Z
Learnt from: CR
Repo: zenstackhq/zenstack-v3 PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-11-26T01:55:04.540Z
Learning: Applies to **/*.zmodel : Always run `zenstack generate` after modifying ZModel schemas
Applied to files:
scripts/test-generate.ts
📚 Learning: 2025-11-26T01:55:04.540Z
Learnt from: CR
Repo: zenstackhq/zenstack-v3 PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-11-26T01:55:04.540Z
Learning: Applies to packages/zenstackhq/cli/**/*.test.{ts,tsx} : CLI package tests should focus on action-specific tests for each command
Applied to files:
packages/clients/tanstack-query/package.json
📚 Learning: 2025-11-26T01:55:04.540Z
Learnt from: CR
Repo: zenstackhq/zenstack-v3 PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-11-26T01:55:04.540Z
Learning: Use Turbo for build orchestration and run `pnpm build`, `pnpm watch`, `pnpm lint`, and `pnpm test` for development tasks
Applied to files:
packages/clients/tanstack-query/package.json
📚 Learning: 2025-10-21T16:09:31.218Z
Learnt from: ymc9
Repo: zenstackhq/zenstack-v3 PR: 319
File: packages/runtime/src/client/executor/zenstack-query-executor.ts:63-72
Timestamp: 2025-10-21T16:09:31.218Z
Learning: In ZenStack, TypeDefs can be inherited by models. When a TypeDef contains fields with `map` attributes, those mapped field names need to be processed by the QueryNameMapper since they become part of the inheriting model's schema. Therefore, when checking if a schema has mapped names (e.g., in `schemaHasMappedNames`), both `schema.models` and `schema.typeDefs` must be inspected for `@map` and `map` attributes.
Applied to files:
tests/e2e/orm/schemas/todo/schema.tspackages/clients/tanstack-query/test/schemas/basic/schema-lite.tstests/regression/test/issue-204/schema.ts
📚 Learning: 2025-11-26T01:55:04.540Z
Learnt from: CR
Repo: zenstackhq/zenstack-v3 PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-11-26T01:55:04.540Z
Learning: Use `pnpm` with workspaces for package management, pinned to version `pnpm10.12.1`
Applied to files:
package.json
📚 Learning: 2025-10-21T16:04:56.292Z
Learnt from: ymc9
Repo: zenstackhq/zenstack-v3 PR: 319
File: packages/runtime/src/client/crud/dialects/base-dialect.ts:745-747
Timestamp: 2025-10-21T16:04:56.292Z
Learning: In packages/runtime/src/client/crud/dialects/base-dialect.ts, it's intentional that buildCursorFilter applies default ordering (via makeDefaultOrderBy fallback) while buildOrderBy does not. This ensures cursor-based pagination always has stable ordering for correctness, while regular queries remain unordered unless explicitly specified. This design is to be consistent with Prisma's pagination requirements.
Applied to files:
packages/orm/src/client/crud-types.ts
🧬 Code graph analysis (20)
tests/e2e/orm/client-api/create-many-and-return.test.ts (1)
packages/testtools/src/client.ts (1)
createTestClient(101-248)
tests/e2e/orm/client-api/update.test.ts (1)
packages/testtools/src/client.ts (1)
createTestClient(101-248)
tests/e2e/orm/client-api/raw-query.test.ts (1)
packages/testtools/src/client.ts (1)
createTestClient(101-248)
packages/orm/src/client/options.ts (1)
packages/schema/src/schema.ts (1)
SchemaDef(11-19)
tests/e2e/orm/client-api/create.test.ts (1)
packages/testtools/src/client.ts (1)
createTestClient(101-248)
tests/e2e/orm/client-api/create-many.test.ts (1)
packages/testtools/src/client.ts (1)
createTestClient(101-248)
scripts/test-generate.ts (2)
packages/sdk/src/ts-schema-generator.ts (1)
generate(64-78)packages/cli/src/utils/exec-utils.ts (1)
execSync(7-16)
tests/e2e/orm/schemas/todo/schema.ts (3)
tests/regression/test/issue-204/schema.ts (2)
SchemaType(9-60)schema(61-61)tests/e2e/orm/schemas/basic/schema.ts (2)
SchemaType(9-286)schema(287-287)packages/schema/src/schema.ts (1)
SchemaDef(11-19)
packages/orm/src/client/contract.ts (3)
packages/schema/src/schema.ts (1)
GetModels(121-121)packages/orm/src/client/options.ts (2)
ToQueryOptions(156-156)QueryOptions(151-151)packages/orm/src/client/crud-types.ts (2)
SimplifiedPlainResult(256-261)DefaultModelResult(52-82)
tests/regression/test/issue-204/input.ts (3)
packages/clients/tanstack-query/test/schemas/basic/input.ts (1)
FooGetPayload(90-90)tests/e2e/orm/schemas/auth-type/input.ts (1)
FooGetPayload(30-30)tests/e2e/orm/schemas/json/input.ts (1)
FooGetPayload(30-30)
tests/e2e/orm/schemas/todo/input.ts (6)
tests/e2e/apps/rally/zenstack/input.ts (2)
SpaceGetPayload(270-270)UserGetPayload(50-50)packages/clients/tanstack-query/test/schemas/basic/input.ts (1)
UserGetPayload(30-30)samples/next.js/zenstack/input.ts (1)
UserGetPayload(30-30)samples/orm/zenstack/input.ts (1)
UserGetPayload(30-30)tests/e2e/orm/schemas/basic/input.ts (1)
UserGetPayload(30-30)tests/e2e/orm/schemas/default-auth/input.ts (1)
UserGetPayload(30-30)
packages/clients/tanstack-query/src/react.ts (5)
packages/clients/tanstack-query/src/vue.ts (3)
ModelQueryHooks(127-206)ModelQueryOptions(87-89)ModelQueryResult(91-91)packages/orm/src/client/crud-types.ts (2)
SimplifiedResult(247-254)SimplifiedPlainResult(256-261)packages/schema/src/schema.ts (2)
SchemaDef(11-19)GetModels(121-121)packages/clients/tanstack-query/src/utils/types.ts (1)
TrimDelegateModelOperations(28-32)packages/common-helpers/src/lower-case-first.ts (1)
lowerCaseFirst(1-3)
tests/regression/test/issue-204/schema.ts (3)
packages/clients/tanstack-query/test/schemas/basic/schema-lite.ts (2)
SchemaType(9-171)schema(172-172)tests/e2e/orm/schemas/todo/schema.ts (2)
SchemaType(9-395)schema(396-396)packages/schema/src/schema.ts (1)
SchemaDef(11-19)
packages/clients/tanstack-query/test/schemas/basic/input.ts (3)
samples/orm/zenstack/input.ts (2)
UserGetPayload(30-30)PostGetPayload(70-70)tests/e2e/github-repos/formbricks/input.ts (1)
UserGetPayload(510-510)tests/e2e/orm/schemas/basic/input.ts (2)
UserGetPayload(30-30)PostGetPayload(50-50)
packages/clients/tanstack-query/src/svelte.ts (5)
packages/orm/src/client/options.ts (1)
QueryOptions(151-151)packages/clients/tanstack-query/src/react.ts (6)
ClientHooks(141-143)ModelQueryHooks(147-261)ModelQueryOptions(96-96)ModelQueryResult(98-98)useClientQueries(266-279)useModelQueries(284-389)packages/orm/src/client/crud-types.ts (2)
SimplifiedResult(247-254)SimplifiedPlainResult(256-261)packages/schema/src/schema.ts (2)
SchemaDef(11-19)GetModels(121-121)packages/clients/tanstack-query/src/utils/types.ts (1)
TrimDelegateModelOperations(28-32)
tests/e2e/orm/schemas/typing/input.ts (16)
packages/clients/tanstack-query/test/schemas/basic/input.ts (2)
UserGetPayload(30-30)PostGetPayload(50-50)samples/next.js/zenstack/input.ts (2)
UserGetPayload(30-30)PostGetPayload(50-50)tests/e2e/apps/rally/zenstack/input.ts (1)
UserGetPayload(50-50)tests/e2e/github-repos/formbricks/input.ts (2)
UserGetPayload(510-510)TagGetPayload(150-150)tests/e2e/github-repos/trigger.dev/input.ts (1)
UserGetPayload(30-30)tests/e2e/orm/schemas/default-auth/input.ts (2)
UserGetPayload(30-30)ProfileGetPayload(50-50)tests/e2e/orm/schemas/delegate/input.ts (1)
UserGetPayload(30-30)tests/e2e/orm/schemas/name-mapping/input.ts (2)
UserGetPayload(30-30)PostGetPayload(50-50)tests/e2e/orm/schemas/omit/input.ts (2)
UserGetPayload(30-30)PostGetPayload(50-50)tests/e2e/orm/schemas/petstore/input.ts (1)
UserGetPayload(30-30)tests/e2e/orm/schemas/todo/input.ts (1)
UserGetPayload(70-70)tests/e2e/orm/schemas/typed-json/input.ts (1)
UserGetPayload(30-30)tests/regression/test/issue-422/input.ts (2)
UserGetPayload(50-50)ProfileGetPayload(70-70)tests/runtimes/bun/schemas/input.ts (2)
UserGetPayload(30-30)PostGetPayload(50-50)tests/runtimes/edge-runtime/schemas/input.ts (1)
PostGetPayload(50-50)tests/e2e/github-repos/cal.com/input.ts (1)
ProfileGetPayload(210-210)
tests/e2e/orm/schemas/delegate/input.ts (14)
packages/clients/tanstack-query/test/schemas/basic/input.ts (1)
UserGetPayload(30-30)samples/orm/zenstack/input.ts (1)
UserGetPayload(30-30)tests/e2e/apps/rally/zenstack/input.ts (2)
UserGetPayload(50-50)CommentGetPayload(230-230)tests/e2e/github-repos/formbricks/input.ts (1)
UserGetPayload(510-510)tests/e2e/orm/schemas/basic/input.ts (2)
UserGetPayload(30-30)CommentGetPayload(70-70)tests/e2e/orm/schemas/default-auth/input.ts (1)
UserGetPayload(30-30)tests/e2e/orm/schemas/name-mapping/input.ts (1)
UserGetPayload(30-30)tests/e2e/orm/schemas/omit/input.ts (1)
UserGetPayload(30-30)tests/e2e/orm/schemas/petstore/input.ts (1)
UserGetPayload(30-30)tests/e2e/orm/schemas/todo/input.ts (1)
UserGetPayload(70-70)tests/e2e/orm/schemas/typed-json/input.ts (1)
UserGetPayload(30-30)tests/e2e/orm/schemas/typing/input.ts (1)
UserGetPayload(30-30)tests/regression/test/issue-422/input.ts (1)
UserGetPayload(50-50)tests/runtimes/bun/schemas/input.ts (1)
UserGetPayload(30-30)
tests/regression/test/issue-422/input.ts (15)
tests/e2e/apps/rally/zenstack/input.ts (2)
SessionGetPayload(90-90)UserGetPayload(50-50)tests/e2e/github-repos/cal.com/input.ts (2)
SessionGetPayload(730-730)ProfileGetPayload(210-210)packages/clients/tanstack-query/test/schemas/basic/input.ts (1)
UserGetPayload(30-30)samples/next.js/zenstack/input.ts (1)
UserGetPayload(30-30)samples/orm/zenstack/input.ts (2)
UserGetPayload(30-30)ProfileGetPayload(50-50)tests/e2e/github-repos/formbricks/input.ts (1)
UserGetPayload(510-510)tests/e2e/orm/schemas/default-auth/input.ts (2)
UserGetPayload(30-30)ProfileGetPayload(50-50)tests/e2e/orm/schemas/delegate/input.ts (1)
UserGetPayload(30-30)tests/e2e/orm/schemas/name-mapping/input.ts (1)
UserGetPayload(30-30)tests/e2e/orm/schemas/omit/input.ts (1)
UserGetPayload(30-30)tests/e2e/orm/schemas/petstore/input.ts (1)
UserGetPayload(30-30)tests/e2e/orm/schemas/todo/input.ts (1)
UserGetPayload(70-70)tests/e2e/orm/schemas/typed-json/input.ts (1)
UserGetPayload(30-30)tests/e2e/orm/schemas/typing/input.ts (2)
UserGetPayload(30-30)ProfileGetPayload(70-70)tests/runtimes/bun/schemas/input.ts (1)
UserGetPayload(30-30)
tests/e2e/orm/schemas/json/input.ts (3)
packages/clients/tanstack-query/test/schemas/basic/input.ts (1)
FooGetPayload(90-90)tests/e2e/orm/schemas/auth-type/input.ts (1)
FooGetPayload(30-30)tests/regression/test/issue-204/input.ts (1)
FooGetPayload(30-30)
tests/e2e/github-repos/formbricks/input.ts (16)
tests/e2e/github-repos/cal.com/input.ts (5)
WebhookGetPayload(610-610)MembershipGetPayload(330-330)ApiKeyGetPayload(650-650)AccountGetPayload(710-710)UserGetPayload(170-170)tests/e2e/orm/schemas/typing/input.ts (2)
TagGetPayload(90-90)UserGetPayload(30-30)tests/e2e/github-repos/trigger.dev/input.ts (3)
DataMigrationGetPayload(250-250)ProjectGetPayload(190-190)UserGetPayload(30-30)tests/e2e/apps/rally/zenstack/input.ts (2)
AccountGetPayload(30-30)UserGetPayload(50-50)packages/clients/tanstack-query/test/schemas/basic/input.ts (1)
UserGetPayload(30-30)samples/next.js/zenstack/input.ts (1)
UserGetPayload(30-30)samples/orm/zenstack/input.ts (1)
UserGetPayload(30-30)tests/e2e/orm/schemas/basic/input.ts (1)
UserGetPayload(30-30)tests/e2e/orm/schemas/default-auth/input.ts (1)
UserGetPayload(30-30)tests/e2e/orm/schemas/delegate/input.ts (1)
UserGetPayload(30-30)tests/e2e/orm/schemas/name-mapping/input.ts (1)
UserGetPayload(30-30)tests/e2e/orm/schemas/omit/input.ts (1)
UserGetPayload(30-30)tests/e2e/orm/schemas/petstore/input.ts (1)
UserGetPayload(30-30)tests/e2e/orm/schemas/todo/input.ts (1)
UserGetPayload(70-70)tests/e2e/orm/schemas/typed-json/input.ts (1)
UserGetPayload(30-30)tests/regression/test/issue-422/input.ts (1)
UserGetPayload(50-50)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (4)
- GitHub Check: Agent
- GitHub Check: build-test (20.x, sqlite)
- GitHub Check: build-test (20.x, postgresql)
- GitHub Check: claude-review
There was a problem hiding this comment.
Pull request overview
This PR merges dev to main for v3.0.0-beta.29, introducing API refinements and bug fixes. The key changes focus on:
- Renaming
ClientOptionstoQueryOptionsfor query-specific operations - Introducing
SimplifiedPlainResultas a cleaner alternative toSimplifiedModelResult - Fixing SQLite JSON function calls from
jsonb_eachtojson_each - Reordering type parameters in
ModelResultand related types for better consistency
Reviewed changes
Copilot reviewed 74 out of 78 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| packages/orm/src/client/options.ts | Added QueryOptions type as a subset of ClientOptions |
| packages/orm/src/client/crud-types.ts | Renamed SimplifiedModelResult to SimplifiedPlainResult, reordered type parameters |
| packages/orm/src/client/contract.ts | Updated to use QueryOptions and SimplifiedPlainResult |
| packages/orm/src/client/crud/dialects/sqlite.ts | Fixed jsonb_each to json_each for SQLite compatibility |
| packages/sdk/src/ts-schema-generator.ts | Updated code generator to use new type names |
| scripts/test-generate.ts | Added support for passing options to CLI |
| All input.ts files | Regenerated with new ClientOptions→QueryOptions and SimplifiedModelResult→SimplifiedPlainResult |
| All schema.ts files | Regenerated with class-based pattern (SchemaType class) |
| All package.json files | Version bumped to 3.0.0-beta.29 |
| pnpm-lock.yaml | Updated dependency references |
Files not reviewed (1)
- pnpm-lock.yaml: Language not supported
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Summary by CodeRabbit
Release Notes - Version 3.0.0-beta.29
Chores
Bug Fixes
✏️ Tip: You can customize this high-level summary in your review settings.