@zenstackhq/orm 3.5.0-beta.4 → 3.5.0-beta.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +34 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +3 -6
- package/dist/index.d.ts +3 -6
- package/dist/index.js.map +1 -1
- package/package.json +7 -7
package/README.md
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
# @zenstackhq/orm
|
|
2
|
+
|
|
3
|
+
The core ZenStack ORM engine, built on top of [Kysely](https://kysely.dev/). Provides a type-safe database client (`ZenStackClient`) with a high-level, [Prisma](https://prisma.io/)-compatible CRUD API and direct access to the underlying Kysely query builder for advanced queries.
|
|
4
|
+
|
|
5
|
+
## Key Features
|
|
6
|
+
|
|
7
|
+
- **Type-safe CRUD operations** generated from your ZModel schema
|
|
8
|
+
- **Plugin system** for query interception and entity mutation hooks
|
|
9
|
+
- **Multi-dialect support** — SQLite (better-sqlite3), PostgreSQL (pg), and MySQL (mysql2)
|
|
10
|
+
- **Computed fields** evaluated at the database level
|
|
11
|
+
- **Custom procedures** for encapsulating complex queries and mutations
|
|
12
|
+
|
|
13
|
+
## Installation
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
npm install @zenstackhq/orm
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
## Usage
|
|
20
|
+
|
|
21
|
+
```typescript
|
|
22
|
+
import { ZenStackClient } from '@zenstackhq/orm';
|
|
23
|
+
import schema from './schema';
|
|
24
|
+
|
|
25
|
+
const client = new ZenStackClient(schema, {
|
|
26
|
+
/* dialect config */
|
|
27
|
+
});
|
|
28
|
+
|
|
29
|
+
const user = await client.user.findFirst({ where: { email: 'alice@example.com' } });
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
## Learn More
|
|
33
|
+
|
|
34
|
+
- [ZenStack Documentation](https://zenstack.dev/docs)
|