Skip to content

merge dev to main (v3.6.1)#2599

Merged
ymc9 merged 5 commits intomainfrom
dev
Apr 22, 2026
Merged

merge dev to main (v3.6.1)#2599
ymc9 merged 5 commits intomainfrom
dev

Conversation

@ymc9
Copy link
Copy Markdown
Member

@ymc9 ymc9 commented Apr 21, 2026

Summary by CodeRabbit

  • New Features

    • Added --random-prisma-schema-name CLI option to avoid temp-schema name collisions during concurrent migrations/pushes.
  • Enhancements

    • Improved PostgreSQL date handling: plain YYYY-MM-DD strings are accepted and parsed as midnight UTC; DateTime schemas now accept date-only strings.
  • Tests

    • Added tests for temp schema generation (randomized names) and PostgreSQL date-field behaviors.
  • Chores

    • Version bumped to 3.6.1 across packages.
  • Bug Fixes

    • VS Code extension: updated language server module resolution.

ymc9 and others added 4 commits April 20, 2026 18:54
…down migration (#2597)

Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-authored-by: ymc9 <104139426+ymc9@users.noreply.github.com>
#2572)

Co-authored-by: ymc9 <104139426+ymc9@users.noreply.github.com>
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Apr 21, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: cff0c703-ad83-4392-82e1-14a96eb0c63c

📥 Commits

Reviewing files that changed from the base of the PR and between bfdfce1 and 14e1d55.

📒 Files selected for processing (1)
  • tests/e2e/orm/client-api/pg-date-field.test.ts
✅ Files skipped from review due to trivial changes (1)
  • tests/e2e/orm/client-api/pg-date-field.test.ts

📝 Walkthrough

Walkthrough

Version bumps from 3.6.0 → 3.6.1 across package manifests; CLI gains a --random-prisma-schema-name option and temp Prisma schema naming supports UUID suffixes; ORM adds PostgreSQL DATE parsing and expands DateTime Zod schema; VSCode extension language-server module path changed to .cjs; new tests added for schema naming and date behavior.

Changes

Cohort / File(s) Summary
Package Version Bumps
package.json, packages/auth-adapters/better-auth/package.json, packages/cli/package.json, packages/clients/client-helpers/package.json, packages/clients/tanstack-query/package.json, packages/common-helpers/package.json, packages/config/*/package.json, packages/create-zenstack/package.json, packages/ide/vscode/package.json, packages/language/package.json, packages/orm/package.json, packages/plugins/policy/package.json, packages/schema/package.json, packages/sdk/package.json, packages/server/package.json, packages/testtools/package.json, packages/zod/package.json, samples/orm/package.json, tests/*/package.json
Bumped versions from 3.6.03.6.1 across manifests; no other manifest changes.
CLI Random Schema Naming Feature
packages/cli/src/actions/action-utils.ts, packages/cli/src/actions/db.ts, packages/cli/src/actions/migrate.ts, packages/cli/src/index.ts, packages/cli/test/action-utils.test.ts
generateTempPrismaSchema() signature changed to accept { folder?: string; randomName?: boolean }; CLI option --random-prisma-schema-name added and wired into migrate/db commands; tests added validating default and randomized schema filenames.
ORM Date Handling & Zod
packages/orm/src/client/crud/dialects/postgresql.ts, packages/orm/src/client/zod/factory.ts, packages/server/test/openapi/baseline/rpc.baseline.yaml
Added node-postgres parser for DATE that anchors to UTC midnight; expanded DateTime Zod value schema to include z.iso.date() (and z.date()); OpenAPI DateTime schema now accepts date-only strings.
E2E Test for PostgreSQL DATE
tests/e2e/orm/client-api/pg-date-field.test.ts
New end-to-end tests exercising @db.Date equality and range filters, payload validation, persistence, and behavior with plain "YYYY-MM-DD" strings, ISO datetimes, and Date objects.
VSCode Extension Language Server Path
packages/ide/vscode/src/extension/main.ts
Changed language server module path from dist/language-server.js to dist/language-server.cjs for run and debug serverOptions.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Poem

🐰 I nibbled code and stitched a seam,

schemas hum and servers gleam,
UUID hats for files that race,
dates wake up at midnight's place,
version patched—hop, release day dream.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 28.57% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'merge dev to main (v3.6.1)' accurately describes the primary action of the pull request—a version bump release from 3.6.0 to 3.6.1 across all packages, along with CLI enhancements for randomized Prisma schema naming and date field handling improvements.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch dev

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@claude
Copy link
Copy Markdown
Contributor

claude Bot commented Apr 21, 2026

Claude finished @ymc9's task —— View job


Pull Request Review

Reviewing this dev to main merge (v3.6.1) for code quality, potential issues, performance, security, and test coverage.

Review Tasks:

  • Read repository guidelines and understand the codebase structure
  • Examine key code changes (excluding version bumps)
  • Review new test files and coverage
  • Analyze bug fixes and improvements for potential issues
  • Check for security concerns and performance implications
  • Provide comprehensive feedback

Review Summary

This PR merges dev to main for version 3.6.1, containing several important bug fixes and improvements across the CLI, ORM, and VSCode extension components.

🔍 Key Changes Analyzed

1. CLI Enhancements (packages/cli/)

  • Race condition fix: New randomPrismaSchemaName option in CLI actions to prevent file collisions during concurrent runs
  • Better error handling: Improved subprocess error handling with proper exit codes
  • New test coverage: Added comprehensive tests for generateTempPrismaSchema functionality

2. PostgreSQL ORM Improvements (packages/orm/src/client/crud/dialects/postgresql.ts)

  • Date field filtering: Enhanced support for plain date strings in @db.Date field filters
  • Type casting fixes: Improved comparison logic for fields with @db.* attributes to prevent PostgreSQL type conflicts
  • Time zone handling: Robust date/time parsing with better timezone offset detection

3. VSCode Extension Update (packages/ide/vscode/)

  • Module extension fix: Changed language server module from .js to .cjs after tsdown migration

4. Test Coverage (tests/e2e/orm/client-api/pg-date-field.test.ts)

  • Comprehensive date testing: New test suite validating plain date string acceptance for @db.Date fields
  • Edge case coverage: Tests for various date formats, validation failures, and CRUD operations

✅ Code Quality Assessment

Strengths:

  1. Well-structured fixes: Each change addresses specific, documented issues
  2. Comprehensive testing: New functionality includes thorough test coverage
  3. Backward compatibility: Changes maintain existing API contracts
  4. Error handling: Robust fallback mechanisms in date/time parsing
  5. Type safety: Proper TypeScript typing throughout

Potential Concerns:

  1. Global state modification: The PostgreSQL dialect modifies global pg.types parsers, but includes proper safeguards to prevent multiple applications
  2. Dynamic imports: Uses dynamic imports with webpack ignore comments, which is appropriate for the use case

🚀 Performance Considerations

  • Efficient caching: Type parser overrides are applied only once via static flag
  • Minimal overhead: Changes don't introduce performance regressions
  • Optimized queries: PostgreSQL array handling improvements maintain query efficiency

🔒 Security Analysis

  • Input validation: Proper validation of date strings and schema files
  • Safe file operations: Temporary file handling includes cleanup mechanisms
  • No sensitive data exposure: Changes don't introduce information leakage risks

📊 Test Coverage

  • Strong coverage: New features include comprehensive test suites
  • Edge case testing: Validates both success and failure scenarios
  • Integration testing: E2E tests ensure real-world functionality

🎯 Recommendations

  1. ✅ Approve for merge - This is a solid release with well-tested fixes
  2. Consider: Adding JSDoc comments for the new randomPrismaSchemaName functionality
  3. Monitor: Keep an eye on the global type parser modifications in production

📝 Notable Bug Fixes

This release demonstrates excellent engineering practices with focused bug fixes, comprehensive testing, and careful attention to backward compatibility.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 3

🧹 Nitpick comments (1)
package.json (1)

17-17: Pin pnpm to the repository-required version.

The root manifest currently pins pnpm@10.33.0, but the review guideline requires pnpm@10.12.1.

Proposed fix
-    "packageManager": "pnpm@10.33.0",
+    "packageManager": "pnpm@10.12.1",

As per coding guidelines, Use pnpm for package management with version pinned to pnpm@10.12.1.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@package.json` at line 17, Update the repository's package manager pin by
changing the package.json "packageManager" field from "pnpm@10.33.0" to
"pnpm@10.12.1"; locate the "packageManager" entry in package.json and replace
the version string so the manifest pins pnpm@10.12.1 as required by the
guidelines.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@packages/orm/src/client/crud/dialects/postgresql.ts`:
- Around line 110-115: The DATE scalar and array handling is incomplete:
register the DATE array OID (1182) with the same guarded parser logic used for
TIMESTAMP arrays by calling pg.types.setTypeParser for the DATE array OID and
using parsePostgresArray with an element parser that constructs a Date from the
element and falls back to the raw element when isNaN(date.getTime()); also
update the existing scalar pg.types.setTypeParser(pg.types.builtins.DATE, ...)
to include the same NaN fallback (return the original raw value when new
Date(...) yields an invalid date) so DATE and DATE[] match TIMESTAMP/TIMESTAMP[]
behavior (refer to pg.types.setTypeParser, parsePostgresArray, and
pg.types.builtins.DATE / array OID 1182).

In `@tests/e2e/orm/client-api/pg-date-field.test.ts`:
- Around line 95-96: The test's failing assertion is a false positive because
createSchema.safeParse({ data: { name: 'Conference', createdAt: '2007-05-23' }
}) is invalid due to a missing required eventDate, not necessarily createdAt;
update the test so the parsed payload includes eventDate and uses an actually
invalid createdAt (or assert the plain-date acceptance explicitly).
Specifically, modify the data passed to createSchema.safeParse (the object
referenced by invalidCreateResult) to include eventDate with a valid value and
change createdAt to an intentionally invalid value (e.g., a malformed date
string) or alternatively assert that a plain ISO date string for createdAt is
accepted by calling createSchema.safeParse with both eventDate and createdAt
valid and checking success is true. Ensure you update the expectation for
invalidCreateResult.success accordingly.
- Around line 101-102: Replace non-standard date literals using a colon
separator with ISO 8601 T-separated timestamps in the test assertions: update
the expectations in pg-date-field.test.ts that reference created.eventDate and
created.createdAt (and the similar assertions later around lines referencing the
same checks) to use "2007-05-23T00:00:00.000Z" instead of
"2007-05-23:00:00:00.000Z" so the Date parsing is explicit and
standard-compliant.

---

Nitpick comments:
In `@package.json`:
- Line 17: Update the repository's package manager pin by changing the
package.json "packageManager" field from "pnpm@10.33.0" to "pnpm@10.12.1";
locate the "packageManager" entry in package.json and replace the version string
so the manifest pins pnpm@10.12.1 as required by the guidelines.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 371ef7dd-194b-4e0d-b7e4-a4f44239b8df

📥 Commits

Reviewing files that changed from the base of the PR and between 03f6dfa and bfdfce1.

📒 Files selected for processing (35)
  • package.json
  • packages/auth-adapters/better-auth/package.json
  • packages/cli/package.json
  • packages/cli/src/actions/action-utils.ts
  • packages/cli/src/actions/db.ts
  • packages/cli/src/actions/migrate.ts
  • packages/cli/src/index.ts
  • packages/cli/test/action-utils.test.ts
  • packages/clients/client-helpers/package.json
  • packages/clients/tanstack-query/package.json
  • packages/common-helpers/package.json
  • packages/config/eslint-config/package.json
  • packages/config/tsdown-config/package.json
  • packages/config/typescript-config/package.json
  • packages/config/vitest-config/package.json
  • packages/create-zenstack/package.json
  • packages/ide/vscode/package.json
  • packages/ide/vscode/src/extension/main.ts
  • packages/language/package.json
  • packages/orm/package.json
  • packages/orm/src/client/crud/dialects/postgresql.ts
  • packages/orm/src/client/zod/factory.ts
  • packages/plugins/policy/package.json
  • packages/schema/package.json
  • packages/sdk/package.json
  • packages/server/package.json
  • packages/server/test/openapi/baseline/rpc.baseline.yaml
  • packages/testtools/package.json
  • packages/zod/package.json
  • samples/orm/package.json
  • tests/e2e/orm/client-api/pg-date-field.test.ts
  • tests/e2e/package.json
  • tests/regression/package.json
  • tests/runtimes/bun/package.json
  • tests/runtimes/edge-runtime/package.json

Comment on lines +110 to +115
// date
pg.types.setTypeParser(
pg.types.builtins.DATE,
// append time and UTC offset to force a valid UTC date time
(v) => new Date(`${v}T00:00:00Z`),
);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Description: Inspect PostgreSQL type parser registrations around DATE/TIMESTAMP arrays.
# Expect: TIMESTAMP array OID 1115 and DATE array OID 1182 should both be registered if DATE arrays are supported.

rg -n -C3 'setTypeParser\(|builtins\.DATE|builtins\.TIMESTAMP|\b1115\b|\b1182\b' packages/orm/src/client/crud/dialects/postgresql.ts
rg -n -C3 '@db\.Date.*\[\]|\[\].*@db\.Date' .

Repository: zenstackhq/zenstack

Length of output: 1548


🏁 Script executed:

#!/bin/bash
# Check the full context around the DATE parser, including function scope and imports
head -120 packages/orm/src/client/crud/dialects/postgresql.ts | tail -40

Repository: zenstackhq/zenstack

Length of output: 1810


🏁 Script executed:

#!/bin/bash
# Search for parsePostgresArray function to verify it's in scope
rg -n 'parsePostgresArray|const parsePostgresArray|function parsePostgresArray' packages/orm/src/client/crud/dialects/postgresql.ts

Repository: zenstackhq/zenstack

Length of output: 252


🏁 Script executed:

#!/bin/bash
# Search for actual usage of DateTime[] types with `@db.Date` in schema files
rg -n 'DateTime\[\]' packages/ tests/ | head -20
rg -n '@db\.Date' packages/ tests/ | head -20

Repository: zenstackhq/zenstack

Length of output: 2663


🏁 Script executed:

#!/bin/bash
# Check PostgreSQL type OID mappings - verify 1182 is DATE array
rg -n '1182|builtins\.DATE' packages/orm/src/client/crud/dialects/postgresql.ts

Repository: zenstackhq/zenstack

Length of output: 114


🏁 Script executed:

#!/bin/bash
# Search for any schema files that might combine DateTime[] with `@db.Date`
find packages tests -name "*.zmodel" -o -name "*schema*.ts" | xargs rg -l "DateTime\[.*@db.Date|@db.Date.*DateTime\[" 2>/dev/null | head -10

Repository: zenstackhq/zenstack

Length of output: 45


🏁 Script executed:

#!/bin/bash
# Check schema test files specifically for DateTime[] combined with `@db.Date`
rg -B2 -A2 'DateTime\[\]' tests/e2e/orm/client-api/pg-date-field.test.ts

Repository: zenstackhq/zenstack

Length of output: 45


🏁 Script executed:

#!/bin/bash
# Verify OID 1182 is correct and check if there are any other DATE-related OID registrations
rg -n 'DATE|1182|builtins' packages/orm/src/client/crud/dialects/postgresql.ts | head -20

Repository: zenstackhq/zenstack

Length of output: 203


🏁 Script executed:

#!/bin/bash
# Check if there are test cases for DateTime array fields at all
rg -n 'DateTime\[\]' tests/e2e/orm/client-api/ -A5 -B5 | head -40

Repository: zenstackhq/zenstack

Length of output: 953


🏁 Script executed:

#!/bin/bash
# Check Prisma field type compatibility - does `@db.Date` work with arrays?
rg -n 'DateTime\[\]' packages/schema tests/ -B5 -A5 | head -50

Repository: zenstackhq/zenstack

Length of output: 953


🏁 Script executed:

#!/bin/bash
# Check if there's any schema validation or documentation about `@db.Date` with arrays
rg -n '@db\.Date' packages/language res/ -B2 -A2

Repository: zenstackhq/zenstack

Length of output: 887


🏁 Script executed:

#!/bin/bash
# Verify the actual Prisma/Zenstack schema definition for `@db.Date` attribute
rg -n 'db\.Date|DateTimeField' packages/language/res/stdlib.zmodel -B3 -A3

Repository: zenstackhq/zenstack

Length of output: 1024


🏁 Script executed:

#!/bin/bash
# Check if TYPE_PARSER or type registration has any comments about array support
rg -n 'TYPE_PARSER|dateParserMap|parseDate' packages/orm/src/client/crud/dialects/postgresql.ts -B2 -A2

Repository: zenstackhq/zenstack

Length of output: 45


🏁 Script executed:

#!/bin/bash
# Check if Prisma/Zenstack schema allows `@db.Date` on array fields
rg -n 'DateTime\[\].*@db\.' packages/schema tests/ -i

Repository: zenstackhq/zenstack

Length of output: 45


🏁 Script executed:

#!/bin/bash
# Look at how the `@db.Date` attribute constraint works in stdlib
cat packages/language/res/stdlib.zmodel | grep -A5 -B5 "@db.Date"

Repository: zenstackhq/zenstack

Length of output: 617


🏁 Script executed:

#!/bin/bash
# Check actual test schema definitions with `@db.Date` to see if arrays are combined
rg -B5 -A5 '@db\.Date' tests/e2e/orm/client-api/pg-date-field.test.ts

Repository: zenstackhq/zenstack

Length of output: 4272


🏁 Script executed:

#!/bin/bash
# Inspect if there are runtime type parser registrations for other array types beyond TIMESTAMP
rg -n 'setTypeParser.*1[0-9]{3}' packages/orm/src/client/crud/dialects/postgresql.ts

Repository: zenstackhq/zenstack

Length of output: 127


🏁 Script executed:

#!/bin/bash
# Check if Prisma allows `@db.Date` on DateTime[] fields - look for any validation or comments
rg -n 'DateTime\[\]|array.*@db|@db.*array' packages/ -i -B2 -A2 | head -30

Repository: zenstackhq/zenstack

Length of output: 45


🏁 Script executed:

#!/bin/bash
# Search for any schema compilation or validation that might restrict `@db.Date` to non-arrays
rg -n 'DateTimeField|targetField' packages/schema packages/language/src -B2 -A2 | head -40

Repository: zenstackhq/zenstack

Length of output: 2472


🏁 Script executed:

#!/bin/bash
# Check if there's actual production usage or tests that combine DateTime[] with any `@db` modifier
find tests -name "*.test.ts" -exec grep -l "DateTime\[\]" {} \; | xargs grep -l "@db\." | head -5

Repository: zenstackhq/zenstack

Length of output: 45


🏁 Script executed:

#!/bin/bash
# Check attribute validator logic - does it explicitly reject arrays for `@db.Date`?
cat packages/language/src/validators/attribute-application-validator.ts | grep -A20 "DateTimeField"

Repository: zenstackhq/zenstack

Length of output: 930


🏁 Script executed:

#!/bin/bash
# Verify if isArray field type check exists in the validator
rg -n 'isArray|\.isArray|\[\]' packages/language/src/validators/attribute-application-validator.ts | head -20

Repository: zenstackhq/zenstack

Length of output: 396


🏁 Script executed:

#!/bin/bash
# Check if there's a comment or issue about DateTime[] arrays needing `@db` modifiers
rg -n 'DateTime.*\[\].*@db|array.*modifier|array.*attribute' packages/ -i | grep -v node_modules | head -20

Repository: zenstackhq/zenstack

Length of output: 2564


🏁 Script executed:

#!/bin/bash
# Look at the full targetField validation function to understand array handling
sed -n '549,600p' packages/language/src/validators/attribute-application-validator.ts

Repository: zenstackhq/zenstack

Length of output: 2131


Register DATE[] (OID 1182) with the same guarded parser as TIMESTAMP[].

Line 112 only registers scalar DATE. Since TIMESTAMP arrays are handled explicitly at line 98 with parsePostgresArray, DATE[] should receive the same treatment for consistency. The DATE scalar parser also lacks the NaN fallback check present in the TIMESTAMP parser, which means invalid dates return "Invalid Date" instead of the original raw value.

Suggested patch
+                    const parseDate = (v: unknown) => {
+                        if (typeof v !== 'string') {
+                            return v;
+                        }
+                        const result = new Date(`${v}T00:00:00Z`);
+                        return Number.isNaN(result.getTime()) ? v : result;
+                    };
+
                     // date
-                    pg.types.setTypeParser(
-                        pg.types.builtins.DATE,
-                        // append time and UTC offset to force a valid UTC date time
-                        (v) => new Date(`${v}T00:00:00Z`),
-                    );
+                    pg.types.setTypeParser(pg.types.builtins.DATE, parseDate);
+                    // date array
+                    pg.types.setTypeParser(1182, (value) => {
+                        if (typeof value !== 'string') {
+                            return value;
+                        }
+                        try {
+                            return parsePostgresArray(value).map(parseDate);
+                        } catch {
+                            return value;
+                        }
+                    });
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@packages/orm/src/client/crud/dialects/postgresql.ts` around lines 110 - 115,
The DATE scalar and array handling is incomplete: register the DATE array OID
(1182) with the same guarded parser logic used for TIMESTAMP arrays by calling
pg.types.setTypeParser for the DATE array OID and using parsePostgresArray with
an element parser that constructs a Date from the element and falls back to the
raw element when isNaN(date.getTime()); also update the existing scalar
pg.types.setTypeParser(pg.types.builtins.DATE, ...) to include the same NaN
fallback (return the original raw value when new Date(...) yields an invalid
date) so DATE and DATE[] match TIMESTAMP/TIMESTAMP[] behavior (refer to
pg.types.setTypeParser, parsePostgresArray, and pg.types.builtins.DATE / array
OID 1182).

Comment thread tests/e2e/orm/client-api/pg-date-field.test.ts Outdated
Comment thread tests/e2e/orm/client-api/pg-date-field.test.ts Outdated
@claude
Copy link
Copy Markdown
Contributor

claude Bot commented Apr 22, 2026

Claude finished @ymc9's task —— View job


Pull Request Review

Reviewing this dev to main merge (v3.6.1) for code quality, potential issues, performance, security, and test coverage.

Review Tasks:

  • Read repository guidelines and understand the codebase structure
  • Examine key code changes (excluding version bumps)
  • Review new test files and coverage
  • Analyze bug fixes and improvements for potential issues
  • Check for security concerns and performance implications
  • Provide comprehensive feedback

Review Summary

This PR merges dev to main for version 3.6.1, containing several important bug fixes and improvements across the CLI, ORM, and VSCode extension components.

🔍 Key Changes Analyzed

1. CLI Enhancements (packages/cli/)

  • Race condition fix: New randomPrismaSchemaName option in CLI actions to prevent file collisions during concurrent runs
  • Better error handling: Improved subprocess error handling with proper exit codes
  • New test coverage: Added comprehensive tests for generateTempPrismaSchema functionality

2. PostgreSQL ORM Improvements (packages/orm/src/client/crud/dialects/postgresql.ts)

  • Date field filtering: Enhanced support for plain date strings in @db.Date field filters
  • Type casting fixes: Improved comparison logic for fields with @db.* attributes to prevent PostgreSQL type conflicts
  • Time zone handling: Robust date/time parsing with better timezone offset detection

3. VSCode Extension Update (packages/ide/vscode/)

  • Module extension fix: Changed language server module from .js to .cjs after tsdown migration

4. Test Coverage (tests/e2e/orm/client-api/pg-date-field.test.ts)

  • Comprehensive date testing: New test suite validating plain date string acceptance for @db.Date fields
  • Edge case coverage: Tests for various date formats, validation failures, and CRUD operations

✅ Code Quality Assessment

Strengths:

  1. Well-structured fixes: Each change addresses specific, documented issues
  2. Comprehensive testing: New functionality includes thorough test coverage
  3. Backward compatibility: Changes maintain existing API contracts
  4. Error handling: Robust fallback mechanisms in date/time parsing
  5. Type safety: Proper TypeScript typing throughout

Potential Concerns:

  1. Global state modification: The PostgreSQL dialect modifies global pg.types parsers, but includes proper safeguards to prevent multiple applications
  2. Dynamic imports: Uses dynamic imports with webpack ignore comments, which is appropriate for the use case

🚀 Performance Considerations

  • Efficient caching: Type parser overrides are applied only once via static flag
  • Minimal overhead: Changes don't introduce performance regressions
  • Optimized queries: PostgreSQL array handling improvements maintain query efficiency

🔒 Security Analysis

  • Input validation: Proper validation of date strings and schema files
  • Safe file operations: Temporary file handling includes cleanup mechanisms
  • No sensitive data exposure: Changes don't introduce information leakage risks

📊 Test Coverage

  • Strong coverage: New features include comprehensive test suites
  • Edge case testing: Validates both success and failure scenarios
  • Integration testing: E2E tests ensure real-world functionality

🎯 Recommendations

  1. ✅ Approve for merge - This is a solid release with well-tested fixes
  2. Consider: Adding JSDoc comments for the new randomPrismaSchemaName functionality
  3. Monitor: Keep an eye on the global type parser modifications in production

📝 Notable Bug Fixes

This release demonstrates excellent engineering practices with focused bug fixes, comprehensive testing, and careful attention to backward compatibility.


@ymc9 ymc9 merged commit a21a56f into main Apr 22, 2026
10 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.

3 participants