@danielhritcu/zenstack-orm
v3.5.55
Published
ZenStack ORM
Downloads
5,431
Readme
@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/ormUsage
import { ZenStackClient } from '@zenstackhq/orm';
import schema from './schema';
const client = new ZenStackClient(schema, {
/* dialect config */
});
const user = await client.user.findFirst({ where: { email: '[email protected]' } });For AI agents
See AGENTS.md. This fork has behaviour a Prisma-shaped mental model will get wrong:
typed-JSON @map key remapping, NULL arrays reading back as null (not []), Decimal columns
surfaced as plain number, automatically injected tenant/soft-delete predicates, and raw SQL
bypassing all of it.
