Skip to content

chore(deps): update dependency @zenstackhq/orm to v3.9.0 - #76

Open
renovate[bot] wants to merge 1 commit into
masterfrom
renovate/zenstack
Open

chore(deps): update dependency @zenstackhq/orm to v3.9.0#76
renovate[bot] wants to merge 1 commit into
masterfrom
renovate/zenstack

Conversation

@renovate

@renovate renovate Bot commented May 14, 2026

Copy link
Copy Markdown
Contributor

This PR contains the following updates:

Package Change Age Confidence
@zenstackhq/orm (source) 3.6.43.9.0 age confidence

Release Notes

zenstackhq/zenstack (@​zenstackhq/orm)

v3.9.0: ZenStack Release v3.9.0

Compare Source

New Features

Parameterized Computed Fields

Computed fields can now declare typed parameters, with arguments supplied at query time wherever the field is used. This makes computed fields vastly more flexible — e.g., you can let the client control how a dynamic value is calculated. Contributed by @​evgenovalov 🎉. doc

model User {
    id    Int    @id @default(autoincrement())
    posts Post[]
    recentPostCount(since: DateTime) Int @computed
}
const db = new ZenStackClient(schema, {
    dialect,
    computedFields: {
        User: {
            // query-time arguments are passed as the 3rd parameter
            recentPostCount: (eb, ctx, args) =>
                eb
                    .selectFrom('Post')
                    .whereRef('Post.authorId', '=', sql.ref(`${ctx.modelAlias}.id`))
                    .where('Post.createdAt', '>=', args.since)
                    .select(({ fn }) => fn.countAll().as('count')),
        },
    },
});

// `args` is plain data, so it can come directly from a client request
await db.user.findMany({
    orderBy: { recentPostCount: { args: { since }, sort: 'desc' } },
});

Parameterized computed fields are supported in select, include, where, orderBy, aggregate, and groupBy.

Exact Query Argument Typing

TypeScript 6 & 7 changed how excessive properties are checked for function parameters inferred from generics. As a result, unknown keys passed to ZenStack queries are often silently allowed at type checking time, but later triggers runtime validation errors.

The new opt-in typing.exactQueryArgs client option rejects unknown properties recursively — across nested relations, where, select, include, orderBy, and nested mutation inputs. Contributed by @​olup 🙏.

const db = new ZenStackClient(schema, {
    dialect,
    typing: { exactQueryArgs: true },
});

// ✗ compile-time error: unknown property `emial`
await db.user.findMany({ where: { activated: true, emial: 'a@b.com' } });

The option is off by default since the extra checking has a schema-dependent type-checking cost.

Bootstrapping Studio Without a Schema

zen studio now accepts an --introspect flag that introspects your database to generate a schema on the fly when no schema file is found — so you can point Studio at an existing database and start browsing right away.

npx zen studio --introspect

Fixes and Improvements

  • [orm] Fixed enum field filters inside typed JSON fields being incorrectly compared as raw JSON #​2755
  • [orm] Fixed to-one relation filters missing the delegate base join for polymorphic models #​2768
  • [policy] Implicit many-to-many join table deletes are now rejected when a participant side is not updatable #​2752
  • [language] Added per-provider native type mapping diagnostics so invalid @db.* usages are caught at compile time by @​sanny-io #​2759
  • [language] Fixed @db.TinyInt not being allowed on Boolean fields #​2758
  • [language] Native type mappings are now renamed to match the datasource during Prisma schema generation by @​sanny-io
  • [language] Fixed unnamed relations resolving to the wrong opposite field #​2757
  • [cli] Fixed db pull missing relation names when a model has both a to-one and a to-many relation to the same model
  • [cli] Fixed the CLI silently exiting with code zero when the version-check fetch stalls

Full Changelog: zenstackhq/zenstack@v3.8.3...v3.9.0

v3.8.3: ZenStack Release v3.8.3

Compare Source

What's Changed

  • [tanstack-query] Export getQueryKey from all framework entry points
  • [tanstack-query] Fixed a potential crash when traversing cache keys

Full Changelog: zenstackhq/zenstack@v3.8.2...v3.8.3

v3.8.2: ZenStack Release v3.8.2

Compare Source

What's Changed

  • [policy] Fixed a field resolution issue that deep relation access from this keyword may not be resolved to the correct field #​2733 by @​hechang27-sprt

  • [policy] Fixed an issue that incorrect SQL may be generated when accessing a array-typed field from a relation in access policies #​2733 by @​hechang27-sprt

  • Welcome @​hechang27-sprt as our new contributor ❤️ !

Full Changelog: zenstackhq/zenstack@v3.8.1...v3.8.2

v3.8.1: ZenStack Release v3.8.1

Compare Source

What's Changed

  • [policy] improve access policy injection performance by memoizing many-to-many relation info (#​2715) by @​abetss

Welcome @​abetss as our new contributor ❤️ !

Full Changelog: zenstackhq/zenstack@v3.8.0...v3.8.1

v3.8.0: ZenStack Release v3.8.0

Compare Source

New Features

A solid batch of additions in this release 🥳 !

Soft-Delete Plugin

A new @zenstackhq/plugin-soft-delete package (preview) implements soft delete by intercepting Kysely queries. Instead of physically removing rows, delete operations mark them with a timestamp, and reads automatically exclude the marked rows. doc

Declare the plugin and mark a nullable DateTime field with @deletedAt:

plugin softDelete {
    provider = '@zenstackhq/plugin-soft-delete'
}

model User {
    id        Int       @id @default(autoincrement())
    email     String    @unique
    deletedAt DateTime? @deletedAt
}

Install it on your client at runtime:

import { ZenStackClient } from '@zenstackhq/orm';
import { SoftDeletePlugin } from '@zenstackhq/plugin-soft-delete';

const db = new ZenStackClient(schema, { ... }).$use(new SoftDeletePlugin());

// rewritten to set `deletedAt` — the row is kept in the database
await db.user.delete({ where: { id: user.id } });

// returns `null` — soft-deleted rows are hidden from reads
await db.user.findUnique({ where: { id: user.id } });
Date and Time Validation

You can now validate string fields as ISO date and time values with the new @date and @time attributes (backed by zod.iso.date() and zod.iso.time() ). Contributed by @​sanny-io.

model Event {
  id        Int    @id @default(autoincrement())
  startDate String @date
  startTime String @time(3)
}
Auto-Detect Import File Extension

The CLI now auto-detects the import file extension (e.g. .js vs extensionless) from your tsconfig.json when generating code, so generated imports match your module setup out of the box.

Faster Type Checking

We sped up type checking by short-circuiting some of the most expensive tsc traversals and type comparisons. We're seeing 70% speed-up and 70% fewer type instantiations with complex schemas.

For AI Coding Agents

We've published official ZenStack skills to skills.sh.

npx skills add zenstackhq/skills --all

See Setting Up AI Agents for more details.

Fixes and Improvements

  • [policy] Fixed the in operator against enum lists with native enums #​2718
  • [tanstack-query] Fixed pageParam in infinite queries for Vue by @​caiotarifa #​2713
  • [orm] Fixed _count when nested inside an include #​2669
  • [deps] Upgraded Langium to 4.2 to drop vulnerable lodash-es #​2704
  • [orm] Forbid selecting @omit fields when allowQueryTimeOmitOverride is false #​2671
  • [server] Omit relations to sliced-away models from the OpenAPI spec #​2628
  • [orm] Fixed the isEmpty function when using the postgresql dialect by @​sanny-io
  • [language] Forbid duplicate @default applications by @​sanny-io

Full Changelog: zenstackhq/zenstack@v3.7.2...v3.8.0

v3.7.2: ZenStack Release v3.7.2

Compare Source

What's Changed

Full Changelog: zenstackhq/zenstack@v3.7.1...v3.7.2

v3.7.1: ZenStack Release v3.7.1

Compare Source

What's Changed

  • [orm] You can now use the @@delegateMap attribute to control the value used for discriminator field values in polymorphic models by @​wolflu05 doc.
  • [orm] Fixed an invalid Prisma schema generation issue when using ID formatting by @​sanny-io

Full Changelog: zenstackhq/zenstack@v3.7.0...v3.7.1

v3.7.0: ZenStack Release v3.7.0

Compare Source

New Features

Several cool additions landed in this release 🥳 !

Full-Text Search (Postgres Only)

You can now use the fts and _ftsRelevance query fields to do full-text queries against Postgres database doc. Mark fields you want to search with the @fullText attribute and enjoy effortless queries.

model Article {
  id       Int     @id @default(autoincrement())
  title    String  @fullText
  body     String  @fullText
  subtitle String? @fullText
  notes    String? // not full-text-searchable
}
await db.article.findMany({
  where: { title: { fts: { search: 'cat & dog' } } },
});

await db.article.findMany({
  orderBy: {
    _ftsRelevance: { fields: ['body'], search: 'cat & dog', sort: 'desc' },
  },
});
Fuzzy Search (Postgres Only)

You can now use the fuzzy and _fuzzyRelevance query fields to do fuzzy search against Postgres database doc. Mark fields you want to search with the @fuzzy attribute and enjoy effortless queries. This feature requires the pg_trgm extension. Read the docs for more details.

This awesome feature is contributed by @​docloulou .

model Flavor {
  id          Int     @id @default(autoincrement())
  name        String? @fuzzy
  description String  @fuzzy
  notes       String? // not fuzzy-searchable
}
await db.flavor.findMany({
  where: { name: { fuzzy: { search: 'Aple' } } },
});

await db.flavor.findMany({
  orderBy: {
    _fuzzyRelevance: { fields: ['name'], search: 'Apple', sort: 'desc' },
  },
});
Fetch-Based API Client

A new @zenstackhq/fetch-client package is added to provide a simple fetch-based client for consuming the automated CRUD services (RPC-style only). Think of it as the sibling of the @zenstackhq/tanstack-query package, but without framework dependency and complexity of reactive state management. Ideal when you just need a simple, promise-based client. doc

import { createClient } from '@zenstackhq/fetch-client';
import { schema } from '~/zenstack/schema-lite';

const client = createClient(schema, {
  endpoint: 'https://example.com/api/model',
});

const users = await client.user.findMany({ include: { posts: true } });
const post = await client.post.create({ data: { title: 'Hello' } });
TanStack Query Sequential Transactions

You can now use the $transaction.useSequential hook to execute sequential transactions from the frontend doc.

const client = useClientQueries(schema);
const tx = client.$transaction.useSequential();

function onSubmit() {
  tx.mutate([
    { model: 'User', op: 'create', args: { data: { email: 'foo@bar.com' } } },
    { model: 'Post', op: 'create', args: { data: { title: 'Hello' } } },
  ]);
}
Kysely Version Bumped to v0.29.x

We've bumped Kysely dependency version to its latest. Please note that the new version appears to be ESM-only. Please double-check compatibility after the upgrade.

Fixes and Improvements

  • [tanstack-query] You can now use DbNull/JsonNull/AnyNull to filter JSON fields with the query hooks doc
  • [zod] Fixed a JSON field typing inconsistency between zod schemas and ORM types by @​Azzerty23 #​2639
  • [orm] Fixed several issues related to using @db.Time/@db.TimeZ fields by @​erwan-joly #​2633 #​2631
  • [orm] Fixed an infinite recursion issue when validating cyclic strongly-typed JSON #​2654
  • [better-auth] Fixed adapter loading issues when targeting CJS #​2646
  • [policy] Fixed policy plugin detection issue with certain bundlers by @​Albatrosso #​2662
  • [cli] Fixed db pull issue with multiple FK fields targeting the same model by @​svetch
  • Upgraded to TypeScript 6

Full Changelog: zenstackhq/zenstack@v3.6.4...v3.7.0


Welcome @​docloulou and @​Albatrosso as our new contributors ❤️ !


Configuration

📅 Schedule: (UTC)

  • Branch creation
    • At any time (no schedule defined)
  • Automerge
    • At any time (no schedule defined)

🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 Ignore: Close this PR and you won't be reminded about this update again.


  • If you want to rebase/retry this PR, check this box

This PR was generated by Mend Renovate. View the repository job log.

@renovate
renovate Bot force-pushed the renovate/zenstack branch 2 times, most recently from 5298729 to f90df61 Compare May 23, 2026 21:34
@renovate renovate Bot changed the title chore(deps): update dependency @zenstackhq/orm to v3.7.0 chore(deps): update dependency @zenstackhq/orm to v3.7.1 May 23, 2026
@renovate
renovate Bot force-pushed the renovate/zenstack branch from f90df61 to 50bc8ab Compare May 31, 2026 05:46
@renovate renovate Bot changed the title chore(deps): update dependency @zenstackhq/orm to v3.7.1 chore(deps): update dependency @zenstackhq/orm to v3.7.2 May 31, 2026
@renovate renovate Bot changed the title chore(deps): update dependency @zenstackhq/orm to v3.7.2 chore(deps): update zenstack to v3.7.2 Jun 2, 2026
@renovate
renovate Bot force-pushed the renovate/zenstack branch 2 times, most recently from 573dac5 to c669311 Compare June 18, 2026 13:11
@renovate renovate Bot changed the title chore(deps): update zenstack to v3.7.2 chore(deps): update zenstack to v3.8.0 Jun 18, 2026
@renovate renovate Bot changed the title chore(deps): update zenstack to v3.8.0 chore(deps): update zenstack Jun 22, 2026
@renovate renovate Bot changed the title chore(deps): update zenstack chore(deps): update dependency @zenstackhq/orm to v3.8.0 Jun 25, 2026
@renovate
renovate Bot force-pushed the renovate/zenstack branch from c669311 to 2fe5cc9 Compare June 27, 2026 04:26
@renovate renovate Bot changed the title chore(deps): update dependency @zenstackhq/orm to v3.8.0 chore(deps): update dependency @zenstackhq/orm to v3.8.1 Jun 27, 2026
@renovate
renovate Bot force-pushed the renovate/zenstack branch from 2fe5cc9 to 14a356d Compare June 30, 2026 12:09
@renovate renovate Bot changed the title chore(deps): update dependency @zenstackhq/orm to v3.8.1 chore(deps): update dependency @zenstackhq/orm to v3.8.2 Jun 30, 2026
@renovate renovate Bot changed the title chore(deps): update dependency @zenstackhq/orm to v3.8.2 chore(deps): update dependency @zenstackhq/orm to v3.8.3 Jul 5, 2026
@renovate
renovate Bot force-pushed the renovate/zenstack branch from 14a356d to 4e70f2a Compare July 5, 2026 00:42
@renovate
renovate Bot force-pushed the renovate/zenstack branch from 4e70f2a to ac17da4 Compare July 12, 2026 15:45
@renovate
renovate Bot force-pushed the renovate/zenstack branch from ac17da4 to 462bf06 Compare July 20, 2026 21:07
@renovate
renovate Bot force-pushed the renovate/zenstack branch from 462bf06 to f6108e2 Compare August 3, 2026 14:15
@renovate renovate Bot changed the title chore(deps): update dependency @zenstackhq/orm to v3.8.3 chore(deps): update dependency @zenstackhq/orm to v3.9.0 Aug 3, 2026
@renovate
renovate Bot force-pushed the renovate/zenstack branch from f6108e2 to 2d644ea Compare August 12, 2026 03:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants