|
24 | 24 |
|
25 | 25 | ZenStack is a TypeScript database toolkit for developing full-stack or backend Node.js/Bun applications. It provides a unified data modeling and access solution with the following features: |
26 | 26 |
|
27 | | -- A modern schema-first ORM that's compatible with [Prisma](https://github.com/prisma/prisma)'s schema and API |
28 | | -- Versatile data access APIs: high-level (Prisma-style) ORM queries + low-level ([Kysely](https://github.com/kysely-org/kysely)) query builder |
29 | | -- Built-in access control and data validation |
30 | | -- Advanced data modeling patterns like [polymorphism](https://zenstack.dev/blog/polymorphism) |
31 | | -- Designed for extensibility and flexibility: plugins, life-cycle hooks, etc. |
32 | | -- Automatic CRUD web APIs with adapters for popular frameworks |
33 | | -- Automatic [TanStack Query](https://github.com/TanStack/query) hooks for easy CRUD from the frontend |
| 27 | +- A modern schema-first ORM that's compatible with [Prisma](https://github.com/prisma/prisma)'s schema and API |
| 28 | +- Versatile data access APIs: high-level (Prisma-style) ORM queries + low-level ([Kysely](https://github.com/kysely-org/kysely)) query builder |
| 29 | +- Built-in access control and data validation |
| 30 | +- Advanced data modeling patterns like [polymorphism](https://zenstack.dev/blog/polymorphism) |
| 31 | +- Designed for extensibility and flexibility: plugins, life-cycle hooks, etc. |
| 32 | +- Automatic CRUD web APIs with adapters for popular frameworks |
| 33 | +- Automatic [TanStack Query](https://github.com/TanStack/query) hooks for easy CRUD from the frontend |
34 | 34 |
|
35 | 35 | # What's new with V3 |
36 | 36 |
|
@@ -83,10 +83,10 @@ Then create a `zenstack` folder and a `schema.zmodel` file in it. |
83 | 83 |
|
84 | 84 | ZenStack uses a DSL named ZModel to model different aspects of database: |
85 | 85 |
|
86 | | -- Tables and fields |
87 | | -- Validation rules (coming soon) |
88 | | -- Access control policies (coming soon) |
89 | | -- ... |
| 86 | +- Tables and fields |
| 87 | +- Validation rules (coming soon) |
| 88 | +- Access control policies (coming soon) |
| 89 | +- ... |
90 | 90 |
|
91 | 91 | ZModel is a super set of [Prisma Schema Language](https://www.prisma.io/docs/orm/prisma-schema/overview), i.e., every valid Prisma schema is a valid ZModel. |
92 | 92 |
|
@@ -288,9 +288,7 @@ client.$use({ |
288 | 288 | async onQuery({ model, operation, proceed, queryArgs }) { |
289 | 289 | const start = Date.now(); |
290 | 290 | const result = await proceed(queryArgs); |
291 | | - console.log( |
292 | | - `[cost] ${model} ${operation} took ${Date.now() - start}ms` |
293 | | - ); |
| 291 | + console.log(`[cost] ${model} ${operation} took ${Date.now() - start}ms`); |
294 | 292 | return result; |
295 | 293 | }, |
296 | 294 | }); |
@@ -365,19 +363,19 @@ client.$use({ |
365 | 363 |
|
366 | 364 | ZenStack v3 delegates database schema migration to Prisma. The CLI provides Prisma CLI wrappers for managing migrations. |
367 | 365 |
|
368 | | -- Sync schema to dev database and create a migration record: |
| 366 | +- Sync schema to dev database and create a migration record: |
369 | 367 |
|
370 | 368 | ```bash |
371 | 369 | npx zenstack migrate dev |
372 | 370 | ``` |
373 | 371 |
|
374 | | -- Deploy new migrations: |
| 372 | +- Deploy new migrations: |
375 | 373 |
|
376 | 374 | ```bash |
377 | 375 | npx zenstack migrate deploy |
378 | 376 | ``` |
379 | 377 |
|
380 | | -- Reset dev database |
| 378 | +- Reset dev database |
381 | 379 |
|
382 | 380 | ```bash |
383 | 381 | npx zenstack migrate reset |
|
0 commit comments