Skip to content

ZenStack Release v3.2.0

Choose a tag to compare

@github-actions github-actions released this 09 Jan 11:35
· 38 commits to main since this release
b0996b4

🎉 New Features

Lots of cool stuff just landed, guys!

🚀 Custom Procedures

Use the new procedure keyword to define custom procedures in ZModel, and implement them with TypeScript. The procedures are accessible with the ORM client, the QaaS query services, and the TanStack Query hooks.

// get blog post feeds for a given user
procedure getUserFeeds(userId: Int, limit: Int?) : Post[] 

// sign up a new user
mutation procedure signUp(email: String) : User

This powerful feature is implemented by @mwillbanks doc

🚀 Field-level Access Control

Use the @allow and @deny attributes to define "read" or "update" rules for fields. doc

🚀 exists API

Use it to more easily and performantly check if rows matching a condition exist. Available through the ORM client, QaaS, and TanStack Query hooks. This amazing addition is implemented by @sanny-io

await db.post.exists({ where: { published: true } });

🚀 CLI Watch Mode

You can now run the CLI generation in watch mode with zen generate --watch. It detects input changes (the main ZModel and all its imports) and reruns generation automatically. Thanks @DoctorFTB for adding this long-awaited feature!

🚀 Community Package for TRPC

@olup created the zenstack-trpc package for automatically deriving tRPC routers from ZenStack v3 schemas. Compared to ZenStack v2's tRPC integration, this new implementation is much lighter-weight (no code-gen), and provides awesome type-safety. Check the repo for details!

🛠️ Improvements and Fixes

  • Fixed enum array CRUD issues with postgresql #576
  • Preserve zod validation errors when validating custom json types #558 (from v3.1.1)

Full Changelog: v3.1.1...v3.2.0