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.
- 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
npm install @zenstackhq/ormimport { 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' } });