zenstack/packages/orm
github-actions[bot] fd8db57ef2
[CI] Bump version 3.6.2 (#2604)
Co-authored-by: ymc9 <104139426+ymc9@users.noreply.github.com>
2026-04-22 10:54:53 -07:00
..
src fix(orm): accept plain date strings in DateTime @db.Date field filters (#2572) 2026-04-21 16:46:30 -07:00
test custom procedures (#551) 2026-01-08 11:21:51 +08: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.6.2 (#2604) 2026-04-22 10:54:53 -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 chore: migrate from tsup to tsdown (#2580) 2026-04-15 12:13:34 -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