Skip to content

Latest commit

 

History

History

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

README.md

@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