zenstack/packages/orm
github-actions[bot] 87644178b3
[CI] Bump version 3.7.1 (#2678)
Co-authored-by: ymc9 <104139426+ymc9@users.noreply.github.com>
2026-05-22 08:31:58 -07:00
..
src feat(orm): implement delegateMap attribute (#2676) 2026-05-22 08:31:43 -07:00
test fix(zod): json type compatibility between inferred zod types and @zenstackhq/orm types (#2641) 2026-05-05 17:17:08 -07:00
eslint.config.js refactor: rename runtime package to orm (#332) 2025-10-23 22:07:55 -07:00
package.json [CI] Bump version 3.7.1 (#2678) 2026-05-22 08:31:58 -07:00
README.md docs: add README.md to all public packages 2026-03-22 21:51:13 -07:00
tsconfig.json refactor: rename runtime package to orm (#332) 2025-10-23 22:07:55 -07:00
tsdown.config.ts fix(tanstack-query): support DbNull/JsonNull/AnyNull serialization over the wire 2026-04-29 22:59:43 -07:00
vitest.config.ts refactor: rename runtime package to orm (#332) 2025-10-23 22:07:55 -07:00

@zenstackhq/orm

The core ZenStack ORM engine, built on top of Kysely. Provides a type-safe database client (ZenStackClient) with a high-level, Prisma-compatible CRUD API and direct access to the underlying Kysely query builder for advanced queries.

Key Features

  • Type-safe CRUD operations generated from your ZModel schema
  • Plugin system for query interception and entity mutation hooks
  • Multi-dialect support — SQLite (better-sqlite3), PostgreSQL (pg), and MySQL (mysql2)
  • Computed fields evaluated at the database level
  • Custom procedures for encapsulating complex queries and mutations

Installation

npm install @zenstackhq/orm

Usage

import { ZenStackClient } from '@zenstackhq/orm';
import schema from './schema';

const client = new ZenStackClient(schema, {
    /* dialect config */
});

const user = await client.user.findFirst({ where: { email: 'alice@example.com' } });

Learn More