Skip to content

Releases: zenstackhq/zenstack

ZenStack Release v3.4.6

11 Mar 22:13
d4fbb38

Choose a tag to compare

Changes in this release

What's Changed

  • [orm] Field default values with @default(now()) are now generated on the client side for behavioral consistency
  • [orm] Fixed the issue that direct value filter with null is not properly compiled to SQL #2472
  • [orm] Added webpack magic comment to suppress bundler (e.g., Next.js) warnings when they process dynamic import of "pg" package #2470

Full Changelog: v3.4.5...v3.4.6

ZenStack Release v3.4.5

08 Mar 02:27
266106c

Choose a tag to compare

What's Changed

  • [orm] Improved long alias name handling to avoid exceeding PG name length limit by @pkudinov #2424
  • [perf] Use EXISTS instead of COUNT subquery for some/none/every relation filters #2440
  • [orm] Fixed the issue that fields inherited from delegate models originating from mixes are not properly handled #2351
  • [policy] Fixed an assert error when evaluating policies for "create" operation involving optional fields by @pkudinov #2460

New Contributors

  • Welcome @pkudinov as our new contributor ❤️ !

Full Changelog: v3.4.4...v3.4.5

ZenStack Release v3.4.4

05 Mar 04:54
552b634

Choose a tag to compare

What's Changed

  • [proxy] Excluded Unsupported type fields
  • [cli] Report error when plugin module cannot be resolved #2393
  • [orm] Fixed toposort cyclic dependency issue with the $pushSchema test API #2435

Full Changelog: v3.4.3...v3.4.4

ZenStack Release v3.4.3

03 Mar 23:58
51b86db

Choose a tag to compare

What's Changed

  • [cli] Exclude Prisma migrations table from SQLite "db pull" by @svetch
  • [cli] Add "@zenstackhq/schema" package to "npm create zenstack" and "zen init" commands
  • [zod] Fixed the wrong argument handling when processing @length validation attribute #2433

Full Changelog: v3.4.2...v3.4.3

ZenStack Release v3.4.2

02 Mar 15:40
02b0dcc

Choose a tag to compare

What's Changed

  • [ORM] Add an option to skip validating computed fields

Full Changelog: v3.4.0...v3.4.2

ZenStack Release v3.4.1

02 Mar 06:34
c521123

Choose a tag to compare

Changes

  • Fixed an issue that CLI requires "pg" package to be installed.

ZenStack Release v3.4.0

01 Mar 04:21
c521123

Choose a tag to compare

New Features ☀️

Schema Introspection

The new "db pull" command introspects the current database schema and creates an incremental update to your current ZModel. This awesome feature is contributed by @svetch . doc

Slicing ORM API

The new slicing ORM client option allows you to restrict the capabilities of a client - what models to provide, what query operations to allow, what kinds of filtering are supported, etc. doc

const slicedDb = db.$setOptions({
  ...db.$options,
  slicing: {
    // exclude the Comment model entirely
    excludedModels: ['Comment'],
    models: {
      post: {
        // exclude `deleteMany` operation for 'Post' model
        excludedOperations: ['deleteMany'],
        fields: {
          title: {
            // only allow equality filter for "Post.title" field
            includedFilterKinds: ['Equality']
          }
        }
      }
    }
  }
});

Deriving Zod Schemas

This release introduced two Zod schema factories for different validation purposes.

1. Model Validation

A @zenstackhq/zod package is added that provides a factory for creating Zod schemas to validate models, types, and enums as defined in ZModel. doc

This is useful for use cases like using ZModel as the single source of truth for validating form input, etc.

2. ORM Query Args Validation

The ZenStackClient object now exposes a $zod property for creating Zod schemas that validate the input args of ORM API calls, like findUnique, createMany, etc. doc

This is useful for building layers above ZenStack ORM that eventually pass user input to ORM API calls.

Sequential Transaction for RPC API Handler

The RPC API handler now supports sequential transactions via the "$transaction/sequential" endpoint. doc

Fixes and Improvements 🔧

  • Fixed an issue with malformed SQL generation when entity mutation hooks are used with delegate models by @genu .
  • Fixed an issue with malformed SQL generation when calling find APIs with select but without any truthy fields #2344
  • Fixed the issue when "view" is used in ZModel, the Prisma schema generated during migration is not configured with the "views" preview feature #2376
  • Fixed a typing issue that "_count" property is not allowed in nested selection #2343
  • Fixed a malformed SQL generation issue related to field-level policies #2385
  • Fixed the issue that ORM-generated SQL may contain identifiers too long for Postgres #2378
  • Computed fields configuration is validated when creating ZenStackClient by @lsmith77 .
  • Updated several potentially vulnerable dependencies.

Breaking Changes ❗️

  • To make the generated TypeScript schema more portable, the import from "@zenstackhq/orm" is replaced with "@zenstackhq/schema" package. This may cause build errors depending on what package manager you use. It's recommended to explicitly install the "@zenstackhq/schema" package in projects where the TypeScript schema is consumed.

ZenStack Release v2.22.2

29 Dec 12:48
2bc0e5b

Choose a tag to compare

What's Changed

  • Fixed the issue that "url" field in "datasource" block is needed which blocks Prisma 7 usage.
  • Fixed a zod4 compatibility issue when @password attribute is used.

Full Changelog: v2.22.1...v2.22.2

ZenStack Release v2.22.1

04 Dec 01:36
57354f8

Choose a tag to compare

What's Changed

  • [openapi] Fixed the incorrect schema generation when fields are of typedef array type by @olup
  • [cli] Install prisma@6 when initializing a project

Full Changelog: v2.22.0...v2.22.1

ZenStack Release v2.22.0

25 Nov 01:55
b53b1cb

Choose a tag to compare

What's Changed

  • Expanded Prisma peer dependency version's upper bound to 7.x
  • Made the url field of the datasource block in ZModel optional #2309
  • Fixed an issue that auth types are not properly compiled when used with the "prisma-client" generator #2294
  • Avoid import enums from Prisma modules in generated Zod schemas for better portability #2291
  • Fixed a typing compatibility with Prisma 7 by @jamiter

New Contributors

  • Welcome @jamiter as our new contributor! ❤️

⚠️ Important Notes About Prisma 7

Since ZenStack v3 (now beta) has migrated away from Prisma ORM, we don't plan to continue following Prisma's version updates on the v2 track. Although you can install the latest version of ZenStack with Prisma 7, support is not systematically tested nor planned (though the main features seem to work well). We may continue fixing small issues to unblock important use cases, but it'll be on a best-effort basis.

We understand this decision may be inconvenient for some of ZenStack's users, but as an independent team, we don't have influence over Prisma's architecture changes, and it's a significant effort to continue supporting a new major. Please follow the news about v3 and evaluate if an upgrade is viable for you. Thank you for putting confidence into ZenStack!

Full Changelog: v2.21.1...v2.22.0