Conversation
WalkthroughThis update primarily increments the version number from Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~15–20 minutes Poem
Note ⚡️ Unit Test Generation is now available in beta!Learn more here, or try it out under "Finishing Touches" below. ✨ Finishing Touches
🧪 Generate unit tests
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. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
Documentation and Community
|
|
Claude finished @ymc9's task —— View job Pull Request Review Complete ✅I've completed a comprehensive review of this PR which merges dev to main for version 3.0.0-alpha.18. Here's my detailed analysis: Review Tasks:
📋 SummaryThis PR appears to be a routine release preparation, updating version numbers across all packages from ✅ Positive FindingsVersion Consistency
Code Quality
Bug Fixes & Improvements
Security
🔍 Detailed AnalysisRuntime Contract Changes (contract.ts)
CRUD Operations (base.ts)
Test Coverage
Performance Implications
🎯 Recommendations
🏷️ Change Classification
This is a solid maintenance release that addresses specific SQLite issues while maintaining code quality and backwards compatibility. |
There was a problem hiding this comment.
Pull Request Overview
This PR merges the dev branch to main, primarily consisting of a version bump from 3.0.0-alpha.17 to 3.0.0-alpha.18 across all packages, along with improvements to database dialect handling for default values and documentation updates.
- Version bump across all packages from 3.0.0-alpha.17 to 3.0.0-alpha.18
- Added dialect-specific support for INSERT with DEFAULT values, particularly for SQLite compatibility
- Updated documentation examples to use consistent
dbvariable naming instead ofclient
Reviewed Changes
Copilot reviewed 23 out of 23 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| package.json (root) | Version bump to 3.0.0-alpha.18 |
| packages/*/package.json | Version updates across all package manifests |
| packages/runtime/src/client/crud/dialects/base.ts | Added abstract supportInsertWithDefault property |
| packages/runtime/src/client/crud/dialects/sqlite.ts | Implemented SQLite-specific INSERT DEFAULT handling |
| packages/runtime/src/client/crud/dialects/postgresql.ts | Added PostgreSQL INSERT DEFAULT support |
| packages/runtime/src/client/crud/operations/base.ts | Enhanced createMany operation to handle default values for non-supporting dialects |
| packages/runtime/src/client/contract.ts | Updated documentation examples from 'client' to 'db' variable naming |
| packages/runtime/test/client-api/default-values.test.ts | Updated test schema and added comprehensive default value testing |
There was a problem hiding this comment.
Actionable comments posted: 0
♻️ Duplicate comments (1)
packages/dialects/sql.js/package.json (1)
3-3: Same check as aboveThis is the identical version bump; please run the verification script from the other comment to ensure full consistency across the workspace.
🧹 Nitpick comments (3)
packages/runtime/src/client/crud/dialects/base.ts (1)
970-974: Rename getter to match existing “supports” naming convention*Existing capability flags (
supportsUpdateWithLimit,supportsDeleteWithLimit,supportsDistinctOn) all use thesupports*prefix. For consistency and easier discoverability, rename the new flag accordingly and adjust the JSDoc grammar:-/** - * Whether the dialect support inserting with `DEFAULT` as field value. - */ -abstract get supportInsertWithDefault(): boolean; +/** + * Whether the dialect supports inserting with `DEFAULT` as a field value. + */ +abstract get supportsInsertWithDefault(): boolean;Remember to update all usages and overrides in concrete dialects.
packages/runtime/src/client/crud/dialects/sqlite.ts (1)
285-288: Synchronise override name with the base getterIf the base class is renamed to
supportsInsertWithDefault(see previous comment), adjust the override accordingly:-override get supportInsertWithDefault() { +override get supportsInsertWithDefault() { return false; }No behavioural change—just a naming alignment.
packages/runtime/src/client/crud/dialects/postgresql.ts (1)
345-348: Keep naming consistent with base after refactorEchoing the earlier suggestion, update the override if the base getter is renamed:
-override get supportInsertWithDefault() { +override get supportsInsertWithDefault() { return true; }This preserves the intended semantics while maintaining a coherent API surface.
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (23)
package.json(1 hunks)packages/cli/package.json(1 hunks)packages/common-helpers/package.json(1 hunks)packages/create-zenstack/package.json(1 hunks)packages/dialects/sql.js/package.json(1 hunks)packages/eslint-config/package.json(1 hunks)packages/ide/vscode/package.json(1 hunks)packages/language/package.json(1 hunks)packages/runtime/package.json(1 hunks)packages/runtime/src/client/contract.ts(28 hunks)packages/runtime/src/client/crud/dialects/base.ts(1 hunks)packages/runtime/src/client/crud/dialects/postgresql.ts(1 hunks)packages/runtime/src/client/crud/dialects/sqlite.ts(1 hunks)packages/runtime/src/client/crud/operations/base.ts(2 hunks)packages/runtime/test/client-api/default-values.test.ts(3 hunks)packages/sdk/package.json(1 hunks)packages/tanstack-query/package.json(1 hunks)packages/testtools/package.json(1 hunks)packages/typescript-config/package.json(1 hunks)packages/vitest-config/package.json(1 hunks)packages/zod/package.json(1 hunks)samples/blog/package.json(1 hunks)tests/e2e/package.json(1 hunks)
🧰 Additional context used
📓 Path-based instructions (2)
{packages,samples,tests}/**
📄 CodeRabbit Inference Engine (CLAUDE.md)
Packages are located in
packages/,samples/, andtests/
Files:
packages/runtime/src/client/crud/dialects/sqlite.tspackages/sdk/package.jsonpackages/runtime/test/client-api/default-values.test.tspackages/ide/vscode/package.jsonpackages/tanstack-query/package.jsonpackages/eslint-config/package.jsonpackages/language/package.jsonpackages/testtools/package.jsontests/e2e/package.jsonpackages/cli/package.jsonpackages/runtime/src/client/crud/dialects/base.tspackages/zod/package.jsonpackages/common-helpers/package.jsonpackages/runtime/package.jsonpackages/create-zenstack/package.jsonpackages/dialects/sql.js/package.jsonsamples/blog/package.jsonpackages/vitest-config/package.jsonpackages/runtime/src/client/crud/operations/base.tspackages/runtime/src/client/crud/dialects/postgresql.tspackages/typescript-config/package.jsonpackages/runtime/src/client/contract.ts
tests/e2e/**
📄 CodeRabbit Inference Engine (CLAUDE.md)
E2E tests are in
tests/e2e/directory
Files:
tests/e2e/package.json
🧠 Learnings (7)
📚 Learning: `zenstack generate` compiles zmodel to typescript schema (`schema.ts`)...
Learnt from: CR
PR: zenstackhq/zenstack-v3#0
File: CLAUDE.md:0-0
Timestamp: 2025-08-04T08:43:33.161Z
Learning: `zenstack generate` compiles ZModel to TypeScript schema (`schema.ts`)
Applied to files:
packages/sdk/package.jsonpackages/ide/vscode/package.jsonpackages/tanstack-query/package.jsonpackages/language/package.jsonpackage.jsonpackages/cli/package.jsonpackages/zod/package.jsonpackages/create-zenstack/package.jsonpackages/vitest-config/package.jsonpackages/typescript-config/package.json
📚 Learning: schema-first approach with zmodel dsl extension of prisma schema language...
Learnt from: CR
PR: zenstackhq/zenstack-v3#0
File: CLAUDE.md:0-0
Timestamp: 2025-08-04T08:43:33.161Z
Learning: Schema-first approach with ZModel DSL extension of Prisma schema language
Applied to files:
packages/runtime/test/client-api/default-values.test.tspackages/language/package.json
📚 Learning: e2e tests validate real-world schema compatibility (cal.com, formbricks, trigger.dev)...
Learnt from: CR
PR: zenstackhq/zenstack-v3#0
File: CLAUDE.md:0-0
Timestamp: 2025-08-04T08:43:33.161Z
Learning: E2E tests validate real-world schema compatibility (cal.com, formbricks, trigger.dev)
Applied to files:
packages/runtime/test/client-api/default-values.test.ts
📚 Learning: language-first design: zmodel dsl compiles to typescript, not runtime code generation...
Learnt from: CR
PR: zenstackhq/zenstack-v3#0
File: CLAUDE.md:0-0
Timestamp: 2025-08-04T08:43:33.161Z
Learning: Language-First Design: ZModel DSL compiles to TypeScript, not runtime code generation
Applied to files:
packages/language/package.json
📚 Learning: zmodel schema (`schema.zmodel`) defines database structure and policies...
Learnt from: CR
PR: zenstackhq/zenstack-v3#0
File: CLAUDE.md:0-0
Timestamp: 2025-08-04T08:43:33.161Z
Learning: ZModel schema (`schema.zmodel`) defines database structure and policies
Applied to files:
packages/language/package.json
📚 Learning: applies to tests/e2e/** : e2e tests are in `tests/e2e/` directory...
Learnt from: CR
PR: zenstackhq/zenstack-v3#0
File: CLAUDE.md:0-0
Timestamp: 2025-08-04T08:43:33.161Z
Learning: Applies to tests/e2e/** : E2E tests are in `tests/e2e/` directory
Applied to files:
tests/e2e/package.json
📚 Learning: kysely-based orm: v3 uses kysely as query builder instead of prisma runtime dependency...
Learnt from: CR
PR: zenstackhq/zenstack-v3#0
File: CLAUDE.md:0-0
Timestamp: 2025-08-04T08:43:33.161Z
Learning: Kysely-Based ORM: V3 uses Kysely as query builder instead of Prisma runtime dependency
Applied to files:
packages/dialects/sql.js/package.jsonpackages/runtime/src/client/crud/operations/base.ts
🧬 Code Graph Analysis (2)
packages/runtime/test/client-api/default-values.test.ts (1)
samples/blog/zenstack/schema.ts (1)
schema(9-228)
packages/runtime/src/client/crud/operations/base.ts (2)
packages/sdk/src/schema/schema.ts (1)
BuiltinType(84-94)packages/language/src/generated/ast.ts (1)
BuiltinType(101-101)
⏰ 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). (2)
- GitHub Check: build-test (20.x)
- GitHub Check: claude-review
🔇 Additional comments (26)
packages/runtime/src/client/crud/operations/base.ts (2)
522-528: LGTM! Good cleanup of dead code.Removing the commented-out try-catch block improves code readability. The error handling appears to be managed by the
executeQueryTakeFirstmethod, making this wrapper redundant.
873-907: LGTM! Well-implemented dialect-specific default value handling.This enhancement elegantly handles dialects that don't support
DEFAULTas insert field values by pre-populating missing fields with their actual default values. The implementation correctly:
- Collects all fields across the batch to ensure consistency
- Only fills primitive defaults (excluding objects which likely contain expressions)
- Uses dialect-specific transformation for the default values
The logic ensures all rows have matching field sets, which is essential for batch inserts in restrictive SQL dialects.
packages/runtime/src/client/contract.ts (4)
62-62: LGTM! Documentation consistency improvement.The variable name change from
clienttodbin the raw query method examples improves clarity and follows common database client naming conventions.Also applies to: 72-72, 81-81, 91-91
228-287: LGTM! Consistent documentation improvement.The variable name changes from
clienttodbin all CRUD operation examples maintain consistency with the raw query method updates and improve code readability.Also applies to: 353-395, 409-424, 439-446, 461-564, 581-591, 605-617, 631-641, 655-663, 678-686, 701-710, 723-731, 744-766
312-312: findUnique args required — no empty calls foundI searched across all TS/JS files and confirmed every
findUnique(invocation includes anargsobject (no occurrences of emptyfindUnique()). Since all existing calls supply the required parameters, this breaking change is safe to merge.
322-322: findUniqueOrThrow args requirement verified
A repository-wide search confirms everyfindUniqueOrThrowcall provides the requiredargsobject (no invocations without arguments were found). No further updates are needed.packages/runtime/test/client-api/default-values.test.ts (4)
18-22: LGTM! Schema changes support enhanced default value testing.The schema restructuring properly:
- Introduces an
Intprimary key (id) for cleaner test data- Retains
uuidfield with default generator for testing- Adds
boolfield with defaultfalsefor simple default value validation- Updates
idFieldsanduniqueFieldsconsistentlyThese changes align well with the broader default value handling improvements mentioned in the AI summary.
Also applies to: 63-67, 69-69, 71-71
79-79: LGTM! Improved test naming.The test name change from "supports generators" to "supports defaults" more accurately describes the test's purpose and aligns with the file name.
85-85: LGTM! Test data adaptation to new schema.The explicit
id: 1provision adapts correctly to the new Int primary key schema structure.
95-106: Excellent test coverage for batch default values.The new
createManytests comprehensively validate default value behavior:
- Verifies default
falseis applied whenboolfield is omitted (id: 2)- Confirms explicit
truevalue is preserved when provided (id: 3)- Tests both scenarios in a single batch operation
This aligns well with the runtime improvements for default value handling in batch inserts mentioned in the AI summary.
packages/zod/package.json (1)
3-3: Version bump acknowledged – looks goodThe package moves to
3.0.0-alpha.18in sync with the rest of the workspace. No additional changes required.packages/eslint-config/package.json (1)
3-3: Consistent version increment
@zenstackhq/eslint-confignow tracks the monorepo at3.0.0-alpha.18. All good.samples/blog/package.json (1)
3-3: Sample app version updated
sample-blogcorrectly advances to3.0.0-alpha.18. No further action needed.packages/tanstack-query/package.json (1)
3-3: Package version synchronized
@zenstackhq/tanstack-querynow at3.0.0-alpha.18. Peer-dependency ranges remain compatible; everything in order.packages/testtools/package.json (1)
3-3: Version bump verified
@zenstackhq/testtoolsupdated to3.0.0-alpha.18; change aligns with other workspace packages.packages/sdk/package.json (1)
3-3: Version bump acknowledged and approvedPackage version correctly updated to
3.0.0-alpha.18. No other changes detected.packages/runtime/package.json (1)
3-3: Runtime package version bump looks correctThe version field now reflects
3.0.0-alpha.18. Change is consistent with other packages.package.json (1)
3-3: Root package version synchronized successfullyRoot
package.jsonupdated to3.0.0-alpha.18. Matches workspace packages.packages/common-helpers/package.json (1)
3-3: Common-helpers version increment verifiedVersion set to
3.0.0-alpha.18. No additional modifications found.packages/typescript-config/package.json (1)
3-3: TypeScript-config version bump confirmedChange to
3.0.0-alpha.18is correct and in line with the monorepo versioning.tests/e2e/package.json (1)
3-3: Version bump is consistent – no issues spotted.The test package is now aligned with the monorepo’s
alpha.18release. ✔️packages/cli/package.json (1)
6-6: CLI package version correctly incremented.Nothing else changed; ensure any release scripts/CI tags are updated to publish
3.0.0-alpha.18to the registry.packages/language/package.json (1)
4-4: Language package version bump looks good.No additional schema or export changes detected.
packages/ide/vscode/package.json (1)
4-4: VSCode extension version updated correctly.Confirm that the Marketplace pre-release publish step uses this exact version string.
packages/vitest-config/package.json (1)
4-4: Vitest-config package aligned with alpha.18.No further action required.
packages/create-zenstack/package.json (1)
3-3: Monorepo version bump synchronizedAll
package.jsonfiles now reference3.0.0-alpha.18; no occurrences of3.0.0-alpha.17remain. No further action needed.
Summary by CodeRabbit
New Features
Bug Fixes
Tests
Chores